: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.orange {
  background: #fff3e0;
}

.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;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

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

.resource-community {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #f7f8fa;
}

.resource-community p {
  margin: 0;
  color: #6b7684;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.resource-reactions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.resource-reactions button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #4e5968;
  font-size: 13px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px #edf0f3;
}

.resource-reactions button.active {
  background: #e8f3ff;
  color: #1b64da;
  box-shadow: none;
}

.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(6, 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-card.notice-premium {
  border-color: #dceaff;
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
}

.clinical-card.notice-premium .clinical-copy p strong {
  background: #00a86b;
}

.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,
.clinical-card.notice-premium 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-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.trend-section-head .eyebrow {
  margin: 0;
  color: #191f28;
  font-size: 16px;
}

.trend-section-head span {
  color: #8b95a1;
  font-size: 12px;
  font-weight: 850;
}

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

.trend-list-latest {
  display: flex;
  gap: 12px;
  margin: 0 -22px;
  padding: 0 22px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.trend-list-latest::-webkit-scrollbar {
  display: none;
}

.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-list-latest .trend-card {
  flex: 0 0 78%;
  max-width: 292px;
  min-height: 352px;
  scroll-snap-align: start;
}

.trend-card-image {
  width: 100%;
  aspect-ratio: 1.45 / 1;
  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: 230px;
  color: #191f28;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 850;
}

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

.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 8px;
  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-archive {
  margin-top: 36px;
}

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

.trend-archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
  min-height: 116px;
  padding: 15px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(25, 31, 40, 0.04);
}

.trend-archive-row p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  color: #6b7684;
  font-size: 11px;
  font-weight: 850;
}

.trend-archive-row p span {
  padding: 4px 7px;
  border-radius: 8px;
  background: #f2f4f6;
  color: #4e5968;
}

.trend-archive-row em {
  font-style: normal;
  color: #8b95a1;
}

.trend-archive-row h2 {
  margin: 0;
  color: #191f28;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 900;
}

.trend-archive-row strong {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: #6b7684;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.trend-archive-stats {
  margin-top: 8px;
  color: #8b95a1;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.trend-archive-tags {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}

.trend-archive-tags span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #f7f8fa;
  color: #8b95a1;
  font-size: 11px;
  font-weight: 850;
}

.trend-archive-row button {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 52px;
  height: 34px;
  padding: 0 9px 0 11px;
  border: 1px solid rgba(49, 130, 246, 0.16);
  border-radius: 8px;
  background: #f5f9ff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 900;
}

.trend-archive-row button i {
  font-style: normal;
  font-size: 16px;
  line-height: 1;
}

.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;
}

/* Final search layout lock: keep the app in one mobile column even on wide browser panes. */
body.search-mode {
  background: #f7f8fa;
}

body.search-mode main {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: #f7f8fa;
}

body.search-mode .app-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 0 calc(112px + env(safe-area-inset-bottom)) !important;
  background: #f7f8fa !important;
}

body.search-mode .search-screen-head,
body.search-mode .results-panel,
body.search-mode .filters {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  grid-column: 1 / -1 !important;
}

body.search-mode .search-screen-head {
  position: sticky !important;
  top: 0 !important;
  left: auto !important;
  right: auto !important;
  margin: 0 !important;
}

body.search-mode .results-panel {
  margin: 0 !important;
  padding: 0 0 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

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

body.search-mode .result-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 0 14px !important;
}

body.search-mode .filters {
  position: fixed !important;
  right: 14px !important;
  bottom: calc(74px + env(safe-area-inset-bottom)) !important;
  left: 14px !important;
  z-index: 28 !important;
  width: min(calc(100% - 28px), 402px) !important;
  margin: 0 auto !important;
  padding: 8px !important;
  border-radius: 8px !important;
}

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

/* Premium paid-materials prototype */
.premium-screen {
  display: none;
  min-height: 100vh;
  padding: 18px 18px calc(108px + env(safe-area-inset-bottom));
  background: #f7f8fa;
}

.premium-hero,
.premium-section {
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.06);
}

.premium-hero {
  display: grid;
  gap: 16px;
  padding: 24px 20px 20px;
}

.premium-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #6b7684;
}

.premium-kicker span,
.premium-kicker strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f2f4f6;
  white-space: nowrap;
}

.premium-kicker strong {
  color: #1b64da;
  background: #e8f3ff;
}

.premium-hero h1,
.premium-section h2 {
  margin: 0;
  color: #191f28;
  letter-spacing: 0;
}

.premium-hero h1 {
  font-size: 28px;
  line-height: 1.18;
}

.premium-hero p,
.premium-lead,
.premium-price-box p {
  margin: 0;
  color: #4e5968;
  font-size: 15px;
  line-height: 1.65;
}

.premium-actions,
.premium-price-box {
  display: grid;
  grid-template-columns: 1fr 0.86fr;
  gap: 10px;
}

.premium-actions button,
.premium-price-box button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.premium-actions button:first-child,
.premium-price-box button {
  color: #fff;
  background: #3182f6;
}

.premium-actions button:last-child {
  color: #1b64da;
  background: #e8f3ff;
}

.premium-section {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  padding: 18px;
}

.premium-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.premium-section-head .eyebrow {
  margin: 0 0 4px;
}

.premium-section h2 {
  font-size: 20px;
  line-height: 1.3;
}

.premium-included-grid,
.premium-flow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.premium-included-grid article,
.premium-flow article,
.premium-module-list article {
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fbfcfd;
}

.premium-included-grid article {
  display: grid;
  gap: 6px;
  min-height: 94px;
  padding: 14px;
}

.premium-included-grid strong,
.premium-module-list strong,
.premium-flow strong {
  color: #191f28;
  font-size: 15px;
}

.premium-included-grid span,
.premium-module-list p,
.premium-flow p {
  margin: 0;
  color: #6b7684;
  font-size: 12px;
  line-height: 1.45;
}

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

.premium-module-list article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.premium-module-list article > span,
.premium-flow span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #1b64da;
  background: #e8f3ff;
  font-weight: 900;
}

.premium-flow article {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.premium-flow article:last-child {
  grid-column: 1 / -1;
}

.premium-price-box {
  align-items: center;
}

.premium-price-box h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

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

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

body:not(.premium-mode) .premium-screen {
  display: none !important;
}

body.trend-mode .premium-screen,
body.search-mode .premium-screen {
  display: none !important;
}

@media (max-width: 390px) {
  .premium-actions,
  .premium-price-box,
  .premium-included-grid {
    grid-template-columns: 1fr;
  }

  .premium-kicker {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Premium package preview modal */
.premium-preview-modal {
  display: grid;
  gap: 16px;
}

.premium-preview-modal h2,
.premium-preview-modal h3 {
  margin: 0;
  color: #191f28;
  letter-spacing: 0;
}

.premium-preview-modal h2 {
  font-size: 24px;
  line-height: 1.25;
}

.premium-preview-lead,
.premium-preview-list p,
.premium-free-paid p {
  margin: 0;
  color: #4e5968;
  font-size: 14px;
  line-height: 1.62;
}

.premium-preview-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.premium-preview-summary article {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #f7fbff;
}

.premium-preview-summary strong {
  color: #1b64da;
  font-size: 20px;
}

.premium-preview-summary span {
  color: #6b7684;
  font-size: 11px;
  line-height: 1.35;
}

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

.premium-preview-list article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
}

.premium-preview-num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #1b64da;
  background: #e8f3ff;
  font-weight: 900;
}

.premium-preview-list h3 {
  font-size: 16px;
}

.premium-preview-hook {
  margin: 5px 0 6px !important;
  color: #191f28 !important;
  font-weight: 800;
}

.premium-paid-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.premium-paid-tags span {
  padding: 6px 8px;
  border-radius: 999px;
  color: #4e5968;
  background: #f2f4f6;
  font-size: 11px;
  font-weight: 700;
}

.premium-free-paid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.premium-free-paid div {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: #f7f8fa;
}

.premium-free-paid div:last-child {
  background: #e8f3ff;
}

.premium-free-paid h3 {
  font-size: 15px;
}

.premium-preview-actions {
  position: sticky;
  bottom: calc(-22px - env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 0.75fr 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);
}

.premium-preview-actions button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.premium-preview-actions button:first-child {
  color: #4e5968;
  background: #f2f4f6;
}

.premium-preview-actions button:last-child {
  color: #fff;
  background: #3182f6;
}

@media (max-width: 390px) {
  .premium-preview-summary,
  .premium-free-paid {
    grid-template-columns: 1fr;
  }
}


/* Premium commerce redesign */
.premium-screen {
  display: none;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px calc(112px + env(safe-area-inset-bottom));
  background: #f7f8fa;
  color: #191f28;
}

.premium-app-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -14px -14px 12px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid rgba(229, 232, 235, 0.78);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
}

.premium-app-top div {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
}

.premium-app-top button,
.premium-section-head button,
.premium-section-head a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: #1b64da;
  background: #eef6ff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.premium-product-hero,
.premium-purchase-card,
.premium-section {
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.06);
}

.premium-product-hero {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.premium-breadcrumb {
  margin: 0 0 2px;
  color: #6b7684;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.premium-cover-card {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 344px;
  overflow: hidden;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(145deg, #071a5c 0%, #0a2d86 58%, #07133f 100%);
  color: #fff;
}

.premium-cover-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  max-width: 68%;
}

.premium-cover-copy span,
.premium-cover-copy em {
  width: max-content;
  padding: 6px 9px;
  border-radius: 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.premium-cover-copy span {
  background: #ff4d67;
}

.premium-cover-copy em {
  background: rgba(49, 130, 246, 0.92);
}

.premium-cover-copy h1 {
  margin: 2px 0 0;
  color: #fff;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: 0;
}

.premium-cover-copy p,
.premium-cover-copy strong {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.58;
}

.premium-cover-copy strong {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.premium-brain-visual {
  position: absolute;
  right: -18px;
  bottom: 14px;
  width: 170px;
  height: 210px;
  border: 2px solid rgba(112, 197, 255, 0.72);
  border-radius: 50% 45% 48% 44%;
  opacity: 0.95;
  transform: rotate(-6deg);
}

.premium-brain-visual::before,
.premium-brain-visual::after,
.premium-brain-visual i {
  content: "";
  position: absolute;
  border: 2px solid rgba(255, 82, 152, 0.78);
  border-radius: 999px;
}

.premium-brain-visual::before {
  left: 28px;
  top: 46px;
  width: 92px;
  height: 56px;
}

.premium-brain-visual::after {
  left: 48px;
  top: 72px;
  width: 74px;
  height: 42px;
}

.premium-brain-visual i {
  left: 84px;
  top: 106px;
  width: 34px;
  height: 86px;
  border-color: rgba(112, 197, 255, 0.76);
}

.premium-product-hero > h2 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1.24;
  letter-spacing: 0;
}

.premium-product-subtitle {
  margin: 0;
  color: #4e5968;
  font-size: 14px;
  line-height: 1.64;
}

.premium-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #4e5968;
  font-size: 13px;
  font-weight: 800;
}

.premium-product-meta span:first-child {
  color: #f59f00;
}

.premium-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 4px;
}

.premium-spec-grid article {
  display: grid;
  gap: 5px;
  min-height: 70px;
  padding: 10px 6px;
  border-radius: 8px;
  background: #f7f8fa;
  text-align: center;
}

.premium-spec-grid strong {
  color: #191f28;
  font-size: 11px;
  line-height: 1.25;
}

.premium-spec-grid span {
  color: #6b7684;
  font-size: 11px;
  line-height: 1.35;
}

.premium-purchase-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 18px;
}

.premium-purchase-card p,
.premium-purchase-card h2,
.premium-purchase-card ul {
  margin: 0;
}

.premium-purchase-card p {
  color: #191f28;
  font-weight: 900;
}

.premium-purchase-card h2 {
  font-size: 32px;
  letter-spacing: 0;
}

.premium-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.premium-price-row span {
  color: #8b95a1;
  font-size: 15px;
  font-weight: 800;
  text-decoration: line-through;
}

.premium-price-row em {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff4e5;
  color: #f04438;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.premium-buyer-proof {
  color: #3182f6;
  font-size: 13px;
  line-height: 1.45;
}

.premium-purchase-card ul {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
  color: #4e5968;
  font-size: 14px;
}

.premium-purchase-card li::before {
  content: "✓";
  margin-right: 8px;
  color: #3182f6;
  font-weight: 900;
}

.premium-purchase-card button {
  min-height: 52px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
  color: #191f28;
  font-weight: 900;
}

.premium-purchase-card button:first-of-type {
  border: 0;
  background: #3182f6;
  color: #fff;
  box-shadow: 0 10px 20px rgba(49, 130, 246, 0.25);
}

.premium-purchase-card > span {
  color: #6b7684;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.premium-section {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 16px;
}

.premium-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.premium-section-head .eyebrow,
.premium-section-head h2 {
  margin: 0;
}

.premium-section-head h2 {
  font-size: 19px;
  line-height: 1.32;
  letter-spacing: 0;
}

.premium-doc-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 122px;
  gap: 10px;
  margin: 0 -16px;
  padding: 0 16px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.premium-doc-card {
  display: grid;
  gap: 8px;
  scroll-snap-align: start;
}

.doc-page-mini {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 172px;
  padding: 12px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(25, 31, 40, 0.08);
}

.doc-page-mini h3,
.doc-page-mini strong,
.doc-page-mini ul,
.premium-doc-card p {
  margin: 0;
}

.doc-page-mini h3 {
  padding-bottom: 7px;
  border-bottom: 1px solid #e5e8eb;
  font-size: 13px;
  line-height: 1.35;
}

.doc-page-mini strong {
  color: #191f28;
  font-size: 12px;
  line-height: 1.35;
}

.doc-page-mini ul {
  display: grid;
  gap: 5px;
  padding-left: 13px;
  color: #4e5968;
  font-size: 10px;
  line-height: 1.38;
}

.premium-doc-card p {
  color: #4e5968;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.premium-doc-card.locked {
  position: relative;
}

.premium-doc-card.locked .doc-page-mini {
  place-items: center;
  min-height: 172px;
  color: #6b7684;
  background: #f2f4f6;
  text-align: center;
}

.premium-doc-card.locked span {
  position: absolute;
  right: 10px;
  bottom: 34px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #3182f6;
}

.premium-reason-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.premium-reason-grid article {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 12px 8px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fbfcfd;
  text-align: center;
}

.premium-reason-grid strong {
  color: #191f28;
  font-size: 12px;
  line-height: 1.3;
}

.premium-reason-grid span {
  color: #6b7684;
  font-size: 10px;
  line-height: 1.45;
}

.premium-module-list.commerce {
  display: grid;
  gap: 8px;
}

.premium-module-list.commerce article {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
}

.premium-module-list.commerce article > span {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #3182f6;
  color: #fff;
  font-size: 14px;
}

.premium-module-list.commerce strong,
.premium-module-list.commerce p,
.premium-module-list.commerce em {
  margin: 0;
  letter-spacing: 0;
}

.premium-module-list.commerce strong {
  font-size: 15px;
}

.premium-module-list.commerce p {
  margin-top: 4px;
  color: #6b7684;
  font-size: 12px;
  line-height: 1.35;
}

.premium-module-list.commerce em {
  color: #8b95a1;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.premium-social-proof > strong {
  color: #191f28;
  font-size: 34px;
  letter-spacing: 0;
}

.premium-social-proof > strong small {
  color: #6b7684;
  font-size: 16px;
}

.premium-social-proof > p {
  margin: -6px 0 0;
  color: #f59f00;
  font-weight: 800;
}

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

.premium-review-list article,
.premium-qa article {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-top: 1px solid #edf0f3;
}

.premium-review-list b,
.premium-qa strong {
  color: #191f28;
  font-size: 14px;
}

.premium-review-list span,
.premium-qa span {
  color: #4e5968;
  font-size: 13px;
  line-height: 1.58;
}

@media (max-width: 380px) {
  .premium-cover-card {
    min-height: 318px;
    padding: 18px;
  }

  .premium-cover-copy h1 {
    font-size: 31px;
  }

  .premium-spec-grid,
  .premium-reason-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Premium product refinements */
.premium-brain-image {
  position: absolute;
  right: -22px;
  bottom: 6px;
  width: 218px;
  max-width: 62%;
  height: auto;
  object-fit: contain;
  opacity: 0.96;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.32));
}

.premium-brain-visual,
.premium-brain-visual::before,
.premium-brain-visual::after,
.premium-brain-visual i {
  display: none !important;
}

.premium-product-meta span:first-child {
  color: #1b64da;
}

.premium-doc-card {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.doc-page-mini.has-image {
  padding: 0;
  overflow: hidden;
  background: #f7f8fa;
}

.doc-page-mini.has-image img {
  display: block;
  width: 100%;
  height: 172px;
  object-fit: cover;
}

.premium-review-note {
  margin: 0;
  color: #4e5968;
  font-size: 13px;
  line-height: 1.55;
}

.premium-review-form {
  display: grid;
  gap: 8px;
}

.premium-review-form input,
.premium-review-form textarea {
  width: 100%;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #fff;
  color: #191f28;
  font: inherit;
  font-size: 14px;
}

.premium-review-form input {
  min-height: 44px;
  padding: 0 12px;
}

.premium-review-form textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
}

.premium-review-form button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: #3182f6;
  color: #fff;
  font-weight: 900;
}

.premium-review-empty {
  border-top: 1px solid #edf0f3;
}

.premium-preview-large-doc {
  display: grid;
  gap: 14px;
  min-height: 360px;
  padding: 22px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #fff;
}

.premium-preview-large-doc h3,
.premium-preview-large-doc strong,
.premium-preview-large-doc ul {
  margin: 0;
}

.premium-preview-large-doc h3 {
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e8eb;
  font-size: 20px;
}

.premium-preview-large-doc strong {
  font-size: 18px;
}

.premium-preview-large-doc ul {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  color: #4e5968;
  font-size: 15px;
  line-height: 1.6;
}

.premium-preview-large-image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #f7f8fa;
}

.premium-preview-actions.single {
  grid-template-columns: 1fr;
}

@media (max-width: 380px) {
  .premium-brain-image {
    right: -34px;
    width: 196px;
  }
}

/* Premium real preview images */
.premium-doc-strip {
  grid-auto-columns: 118px;
}

.doc-page-mini.has-image {
  min-height: 176px;
  place-items: center;
  background: #f2f4f6;
}

.doc-page-mini.has-image img {
  width: 100%;
  height: 176px;
  object-fit: contain;
  background: #fff;
}

.premium-card-preview-modal {
  gap: 14px;
}

.premium-preview-large-image {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #f7f8fa;
}

/* Premium preview swipe gallery */
.premium-gallery-preview-modal {
  gap: 12px;
}

.premium-gallery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.premium-gallery-head h2,
.premium-gallery-head p {
  margin: 0;
}

.premium-gallery-head span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 8px;
  background: #e8f3ff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 900;
}

.premium-preview-gallery-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 12px;
  margin: 0 -22px;
  padding: 0 22px 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.premium-preview-gallery-track::-webkit-scrollbar {
  display: none;
}

.premium-preview-gallery-page {
  display: grid;
  gap: 8px;
  margin: 0;
  scroll-snap-align: center;
}

.premium-preview-gallery-page img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #f7f8fa;
}

.premium-preview-gallery-page figcaption,
.premium-gallery-hint {
  margin: 0;
  color: #6b7684;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

/* Premium purchase unlock */
.premium-purchase-complete {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #b7ebc6;
  border-radius: 8px;
  background: #ecfdf3;
}

.premium-purchase-complete strong {
  color: #12b76a;
  font-size: 16px;
}

.premium-purchase-complete span,
.premium-access-card p {
  margin: 0;
  color: #4e5968;
  font-size: 13px;
  line-height: 1.55;
}

.premium-primary-link {
  display: grid;
  min-height: 52px;
  place-items: center;
  border-radius: 8px;
  background: #3182f6;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.premium-secondary-button {
  min-height: 48px;
  border: 1px solid #dce3ea !important;
  border-radius: 8px;
  background: #ffffff !important;
  color: #4e5968 !important;
  box-shadow: none !important;
  font-weight: 900;
}


.premium-access-card.locked {
  background: #fbfcfd;
}

.premium-access-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 8px;
  background: #ecfdf3;
  color: #12b76a;
  font-size: 12px;
  font-weight: 900;
}

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

.premium-download-list article {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
}

.premium-download-list article > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.premium-download-list strong {
  color: #191f28;
  font-size: 14px;
  line-height: 1.35;
}

.premium-download-list span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 800;
}

.premium-download-list a,
.premium-download-list button {
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: #eef6ff;
  color: #1b64da;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.premium-download-actions {
  display: flex !important;
  gap: 6px !important;
  justify-content: flex-end;
}

.premium-download-actions a,
.premium-download-actions button {
  min-width: 54px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}


/* Bank transfer order flow */
.bank-order-modal {
  display: grid;
  gap: 14px;
}

.bank-order-modal h2 {
  margin: 0;
  color: #191f28;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}

.bank-order-modal p {
  margin: 0;
  color: #4e5968;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.bank-account-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px 12px;
  padding: 14px;
  border: 1px solid #d7e8ff;
  border-radius: 8px;
  background: #f2f7ff;
}

.bank-account-card span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 850;
}

.bank-account-card strong {
  color: #191f28;
  font-size: 14px;
  font-weight: 900;
  word-break: break-all;
}

.bank-order-form,
.bank-order-lookup {
  display: grid;
  gap: 10px;
}

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

.bank-order-form label span {
  color: #4e5968;
  font-size: 12px;
  font-weight: 900;
}

.bank-order-form input,
.bank-order-form textarea,
.bank-order-lookup input {
  width: 100%;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #fff;
  color: #191f28;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  outline: 0;
}

.bank-order-form input,
.bank-order-lookup input {
  min-height: 46px;
  padding: 0 12px;
}

.bank-order-form textarea {
  min-height: 82px;
  padding: 12px;
  resize: vertical;
}

.bank-order-form button,
.bank-order-modal.submitted button,
.bank-order-lookup button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: #3182f6;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.bank-order-help {
  color: #8b95a1 !important;
  font-size: 12px !important;
}

.bank-order-code {
  display: grid;
  min-height: 54px;
  place-items: center;
  border-radius: 8px;
  background: #191f28;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.bank-status-card {
  background: #fbfcfd;
}

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

.bank-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 8px;
  background: #fff7ed;
  color: #b54708;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.bank-status.approved {
  background: #ecfdf3;
  color: #12b76a;
}

.bank-admin-card {
  background: #fff;
}

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

.bank-admin-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border-radius: 8px;
  background: #f7f8fa;
}

.bank-admin-list article > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

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

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

.bank-admin-list span,
.bank-admin-list em {
  color: #6b7684;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.bank-admin-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.bank-admin-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #d7e8ff;
  border-radius: 8px;
  background: #fff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 900;
}


/* Premium operating settings in admin */
.premium-operating-card {
  background: #ffffff;
}

.premium-operating-form {
  display: grid;
  gap: 12px;
}

.premium-operating-grid,
.premium-link-grid {
  display: grid;
  gap: 10px;
}

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

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

.premium-operating-form label span {
  color: #4e5968;
  font-size: 12px;
  font-weight: 900;
}

.premium-operating-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #ffffff;
  color: #191f28;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  outline: 0;
}

.premium-operating-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #3182f6;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}


/* Desktop admin operating center */
body.admin-mode {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  background: #f7f8fa;
}

body.admin-mode .analytics-admin {
  display: block;
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  min-width: 0;
  margin: 0 auto;
  padding: 0 0 56px;
}

body.admin-mode .admin-top {
  grid-template-columns: 44px minmax(0, 1fr);
  padding: 22px 0 18px;
}

body.admin-mode #analyticsContent {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

body.admin-mode #analyticsContent > .admin-hero,
body.admin-mode #analyticsContent > .admin-toolbar,
body.admin-mode #analyticsContent > .admin-status,
body.admin-mode #analyticsContent > .admin-summary,
body.admin-mode #analyticsContent > .admin-actions {
  grid-column: 1 / -1;
}

body.admin-mode #analyticsContent > .admin-card {
  grid-column: span 6;
  margin-top: 0;
}

body.admin-mode #analyticsContent > .premium-funnel-card,
body.admin-mode #analyticsContent > .insight-card,
body.admin-mode #analyticsContent > .premium-operating-card,
body.admin-mode #analyticsContent > .bank-admin-card {
  grid-column: span 6;
}

body.admin-mode .dashboard-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
}

body.admin-mode .admin-toolbar {
  margin: 0;
}

body.admin-mode .admin-card {
  min-width: 0;
}

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

.premium-funnel-list article {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  padding: 12px;
  border-radius: 8px;
  background: #f7f8fa;
}

.premium-funnel-list article em {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: #3182f6;
}

.premium-funnel-list strong,
.premium-funnel-list b {
  color: #191f28;
  font-size: 13px;
  font-weight: 900;
}

.premium-funnel-list span {
  display: block;
  margin-top: 3px;
  color: #8b95a1;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 900px) {
  body.admin-mode {
    min-width: 0;
    overflow-x: hidden;
  }

  body.admin-mode .analytics-admin {
    width: 100%;
    padding: 0 14px 44px;
  }

  body.admin-mode #analyticsContent {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.admin-mode #analyticsContent > .admin-card,
  body.admin-mode #analyticsContent > .premium-funnel-card,
  body.admin-mode #analyticsContent > .insight-card,
  body.admin-mode #analyticsContent > .premium-operating-card,
  body.admin-mode #analyticsContent > .bank-admin-card {
    grid-column: 1 / -1;
  }

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

/* Force admin to use a desktop canvas, not the mobile app frame */
body.admin-mode::before,
body.admin-mode::after {
  display: none !important;
}

body.admin-mode .analytics-admin {
  width: 1180px !important;
  max-width: none !important;
  min-width: 1180px !important;
  margin: 0 auto !important;
}

@media (max-width: 1180px) {
  body.admin-mode {
    overflow-x: auto !important;
  }

  body.admin-mode .analytics-admin {
    margin-left: 16px !important;
    margin-right: 16px !important;
  }

  body.admin-mode #analyticsContent {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  }

  body.admin-mode #analyticsContent > .admin-card,
  body.admin-mode #analyticsContent > .premium-funnel-card,
  body.admin-mode #analyticsContent > .insight-card,
  body.admin-mode #analyticsContent > .premium-operating-card,
  body.admin-mode #analyticsContent > .bank-admin-card {
    grid-column: span 6 !important;
  }

  body.admin-mode .dashboard-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

.premium-product-meta .sale-live {
  color: #12b76a !important;
  background: #ecfdf3 !important;
}

.premium-review-locked {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #f7f8fa;
  color: #6b7684;
  font-size: 13px;
  font-weight: 850;
}

/* Stable premium settings + scalable bank order admin */
.premium-settings-warning {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #ffd8a8;
  border-radius: 8px;
  background: #fff8ee;
  color: #191f28;
}

.premium-settings-warning strong {
  font-size: 13px;
  font-weight: 900;
}

.premium-settings-warning span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 700;
}

.premium-settings-warning button {
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #191f28;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.premium-settings-warning pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
  color: #333d4b;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.bank-admin-card.wide {
  grid-column: 1 / -1 !important;
}

.bank-admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.bank-admin-summary article {
  padding: 12px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #f9fafb;
}

.bank-admin-summary strong {
  display: block;
  color: #191f28;
  font-size: 20px;
  font-weight: 950;
}

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

.bank-admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
  margin-bottom: 12px;
}

.bank-admin-toolbar input,
.bank-admin-toolbar select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #fff;
  color: #191f28;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.bank-admin-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #edf0f3;
  border-radius: 8px;
}

.bank-admin-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
}

.bank-admin-table th,
.bank-admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf0f3;
  text-align: left;
  vertical-align: top;
}

.bank-admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  color: #4e5968;
  font-size: 11px;
  font-weight: 950;
}

.bank-admin-table td strong,
.bank-admin-table td span,
.bank-admin-table td em {
  display: block;
}

.bank-admin-table td strong {
  color: #191f28;
  font-weight: 950;
}

.bank-admin-table td span,
.bank-admin-table td em {
  color: #6b7684;
  font-style: normal;
  font-weight: 750;
}

.bank-admin-actions.compact {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.bank-admin-actions button.danger {
  border-color: #ffd6d6;
  color: #e03131;
}

@media (max-width: 720px) {
  .bank-admin-summary,
  .bank-admin-toolbar {
    grid-template-columns: 1fr;
  }
}


.bank-order-warning-text {
  padding: 10px 12px;
  border: 1px solid #ffd6d6;
  border-radius: 8px;
  background: #fff5f5;
  color: #e03131;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.5;
}

.bank-privacy-check {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px !important;
  padding: 10px 12px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #f9fafb;
}

.bank-privacy-check input {
  width: 16px !important;
  min-height: 16px !important;
  margin-top: 2px;
  accent-color: #3182f6;
}

.bank-privacy-check span,
.bank-order-privacy-note {
  color: #6b7684;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.bank-order-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 900;
}

.bank-order-divider::before,
.bank-order-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #edf0f3;
}

.bank-order-identity-lookup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.bank-order-identity-lookup input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #fff;
  color: #191f28;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  outline: 0;
}

.bank-order-identity-lookup button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #eef6ff;
  color: #1b64da;
  font-size: 13px;
  font-weight: 950;
}

.premium-test-card {
  background: #ffffff;
}

.premium-test-state {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.premium-test-state article {
  padding: 12px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #f9fafb;
}

.premium-test-state strong {
  display: block;
  color: #191f28;
  font-size: 16px;
  font-weight: 950;
}

.premium-test-state span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 800;
}

.premium-test-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.premium-test-actions button {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #d7e8ff;
  border-radius: 8px;
  background: #ffffff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 900;
}

.premium-test-actions button:first-child {
  border-color: #3182f6;
  background: #3182f6;
  color: #ffffff;
}

@media (max-width: 720px) {
  .premium-test-state,
  .premium-test-actions {
    grid-template-columns: 1fr;
  }
}

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

body.admin-mode .revenue-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.admin-mode .revenue-kpis article {
  border-color: #d7e8ff;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

body.admin-mode .revenue-kpis article strong {
  color: #1b64da;
}

.bank-admin-summary.revenue-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.bank-admin-summary.revenue-summary article:nth-child(-n + 3) {
  border-color: #d7e8ff;
  background: #f7fbff;
}

.bank-admin-summary.revenue-summary article:nth-child(-n + 3) strong {
  color: #1b64da;
}

@media (max-width: 960px) {
  body.admin-mode .revenue-kpis,
  .bank-admin-summary.revenue-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Admin readability upgrade */
body.admin-mode .admin-section-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #e5e8eb;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.06);
}

body.admin-mode .admin-section-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #3182f6, #12b76a);
}

body.admin-mode #analyticsContent > .admin-card.wide {
  grid-column: 1 / -1 !important;
}

body.admin-mode .admin-card-head {
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f3;
}

body.admin-mode .admin-table-wrap {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #edf0f3;
}

body.admin-mode .admin-table th {
  background: #f7f8fa;
  color: #4e5968;
}

body.admin-mode .admin-table td:first-child {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.admin-mode .dashboard-kpis article {
  border-color: #e5e8eb;
  box-shadow: 0 8px 22px rgba(25, 31, 40, 0.05);
}

body.admin-mode .dashboard-kpis article span {
  word-break: keep-all;
}

body.admin-mode .admin-freshness-card {
  grid-column: 1 / -1 !important;
}

.admin-freshness-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-freshness-grid article {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 14px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #f7f8fa;
}

.admin-freshness-grid strong {
  color: #191f28;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.admin-freshness-grid span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 900px) {
  .admin-freshness-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

body.agent-mode .agent-screen {
  display: grid !important;
}

body:not(.agent-mode) .agent-screen {
  display: none !important;
}

body.agent-mode {
  background: #f2f4f6;
}

.agent-screen {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px 96px;
  background: #f7f8fa;
  gap: 12px;
}

.agent-app-top {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 0;
  background: rgba(247, 248, 250, 0.94);
  backdrop-filter: blur(14px);
}

.agent-app-top button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #191f28;
  font-size: 24px;
  box-shadow: 0 8px 18px rgba(25, 31, 40, 0.06);
}

.agent-app-top div {
  display: grid;
  gap: 2px;
}

.agent-app-top strong {
  color: #191f28;
  font-size: 17px;
}

.agent-app-top span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 750;
}

.agent-hero-card,
.agent-chat-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(229, 232, 235, 0.92);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(25, 31, 40, 0.06);
}

.agent-hero-card h2,
.agent-hero-card p {
  margin: 0;
}

.agent-hero-card h2 {
  color: #191f28;
  font-size: 22px;
  line-height: 1.28;
  letter-spacing: 0;
}

.agent-hero-card p:not(.eyebrow) {
  color: #4e5968;
  font-size: 14px;
  line-height: 1.6;
}

.agent-sample-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.agent-sample-row button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dce3ea;
  border-radius: 999px;
  background: #fff;
  color: #191f28;
  font-size: 12px;
  font-weight: 850;
}

.agent-chat-card {
  min-height: 440px;
  grid-template-rows: minmax(320px, 1fr) auto;
  padding: 0;
  overflow: hidden;
}

.agent-message-list {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: calc(100vh - 314px);
  min-height: 320px;
  overflow-y: auto;
  padding: 16px;
}

.agent-message {
  display: grid;
  gap: 6px;
  max-width: 92%;
}

.agent-message span {
  color: #8b95a1;
  font-size: 11px;
  font-weight: 850;
}

.agent-message p {
  margin: 0;
  padding: 12px 13px;
  border-radius: 8px;
  background: #f2f4f6;
  color: #191f28;
  font-size: 14px;
  line-height: 1.65;
}

.agent-message.user {
  justify-self: end;
}

.agent-message.user span {
  text-align: right;
}

.agent-message.user p {
  background: #3182f6;
  color: #fff;
}

.agent-references {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  background: #f7f8fa;
}

.agent-references strong {
  color: #4e5968;
  font-size: 12px;
}

.agent-references button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
  color: #191f28;
  text-align: left;
  font-size: 12px;
  font-weight: 850;
}

.agent-input-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #edf0f3;
  background: #fff;
}

.agent-input-form textarea {
  resize: none;
  min-height: 46px;
  max-height: 120px;
  padding: 13px 12px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  color: #191f28;
  font: inherit;
  line-height: 1.45;
}

.agent-input-form button {
  min-width: 64px;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: #3182f6;
  color: #fff;
  font-weight: 900;
}

.agent-input-form button:disabled,
.agent-input-form textarea:disabled {
  opacity: 0.55;
}

/* Agent UI polish */
body.agent-mode {
  overflow: hidden;
  background: #eef2f6;
}

body.agent-mode .bottom-tabs {
  box-shadow: 0 -8px 24px rgba(25, 31, 40, 0.07);
}

.agent-screen {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(100%, 430px);
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding: 8px 12px calc(80px + env(safe-area-inset-bottom));
  gap: 10px;
  overflow: hidden;
  background: #eef2f6;
}

.agent-app-top {
  min-height: 48px;
  padding: 4px 0;
  background: rgba(238, 242, 246, 0.94);
}

.agent-app-top button {
  width: 34px;
  height: 34px;
  font-size: 22px;
}

.agent-app-top strong {
  font-size: 16px;
}

.agent-app-top span {
  font-size: 11px;
}

.agent-hero-card {
  gap: 7px;
  padding: 13px;
  border: 1px solid #e5e8eb;
  box-shadow: none;
}

.agent-hero-card .eyebrow {
  font-size: 10px;
}

.agent-hero-card h2 {
  font-size: 17px;
  line-height: 1.32;
}

.agent-hero-card p:not(.eyebrow) {
  font-size: 12px;
  line-height: 1.45;
}

.agent-sample-row {
  gap: 6px;
  margin-top: 2px;
}

.agent-sample-row button {
  min-height: 31px;
  padding: 0 10px;
  font-size: 11px;
}

.agent-chat-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  gap: 0;
  padding: 0;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: none;
}

.agent-chat-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f3;
  background: #fff;
}

.agent-chat-status div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agent-chat-status strong {
  color: #191f28;
  font-size: 12px;
  line-height: 1.25;
}

.agent-chat-status span {
  color: #6b7684;
  font-size: 11px;
  line-height: 1.25;
}

.agent-chat-status > i {
  width: 16px;
  height: 16px;
  border: 2px solid #d7e8ff;
  border-top-color: #3182f6;
  border-radius: 50%;
  animation: agentSpin 0.8s linear infinite;
}

.agent-message-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 12px;
  background: #f7f8fa;
}

.agent-message {
  max-width: 96%;
  gap: 4px;
}

.agent-message span {
  padding: 0 2px;
  font-size: 10px;
  line-height: 1.2;
}

.agent-message p {
  padding: 9px 10px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.agent-message.user {
  max-width: 86%;
}

.agent-message.user p {
  border: 0;
  background: #3182f6;
  color: #fff;
}

.agent-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 11px 12px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
}

.agent-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3182f6;
  animation: agentTyping 1s ease-in-out infinite;
}

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

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

.agent-references {
  gap: 5px;
  padding: 8px;
  border: 1px solid #edf0f3;
  background: #fff;
}

.agent-references strong {
  font-size: 11px;
}

.agent-references button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 11px;
}

.agent-input-form {
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 7px;
  padding: 9px;
  border-top: 1px solid #edf0f3;
  background: #fff;
}

.agent-input-form textarea {
  min-height: 40px;
  max-height: 86px;
  padding: 10px;
  font-size: 12.5px;
  line-height: 1.4;
}

.agent-input-form button {
  min-width: 0;
  min-height: 40px;
  font-size: 12px;
}

@keyframes agentSpin {
  to { transform: rotate(360deg); }
}

@keyframes agentTyping {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-3px); opacity: 1; }
}

/* Agent emergency layout fix: keep chat visible on mobile browsers */
body.agent-mode {
  overflow-y: auto !important;
  min-height: 100vh;
}

.agent-screen {
  display: flex !important;
  flex-direction: column;
  width: min(100%, 430px);
  height: auto !important;
  min-height: 100svh;
  padding: 8px 12px calc(92px + env(safe-area-inset-bottom)) !important;
  overflow: visible !important;
}

.agent-app-top,
.agent-hero-card,
.agent-chat-card {
  flex: 0 0 auto;
}

.agent-chat-card {
  display: flex !important;
  flex-direction: column;
  min-height: 430px !important;
  height: auto !important;
  overflow: hidden;
}

.agent-message-list {
  flex: 1 1 auto;
  min-height: 260px !important;
  max-height: min(58vh, 520px) !important;
  overflow-y: auto !important;
}

@media (max-height: 680px) {
  .agent-hero-card {
    padding: 10px 12px;
  }

  .agent-hero-card h2 {
    font-size: 15px;
  }

  .agent-hero-card p:not(.eyebrow) {
    display: none;
  }

  .agent-chat-card {
    min-height: 390px !important;
  }

  .agent-message-list {
    min-height: 230px !important;
    max-height: 50vh !important;
  }
}

/* Agent final visual direction */
body.agent-mode {
  overflow-y: auto !important;
  background: #f3f6fa !important;
}

.agent-screen {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: min(100%, 430px) !important;
  min-height: 100svh !important;
  height: auto !important;
  margin: 0 auto !important;
  padding: 18px 12px calc(92px + env(safe-area-inset-bottom)) !important;
  overflow: visible !important;
  background: #f3f6fa !important;
}

.agent-app-top {
  position: static !important;
  display: grid !important;
  grid-template-columns: 44px 46px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 62px !important;
  padding: 4px 0 10px !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

.agent-app-top button {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #191f28 !important;
  font-size: 28px !important;
  box-shadow: 0 10px 24px rgba(25, 31, 40, 0.06) !important;
}

.agent-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 3px solid #3182f6;
  border-radius: 16px;
  background: #f8fbff;
  color: #3182f6;
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.12);
}

.agent-avatar::before,
.agent-avatar::after {
  content: "";
  position: absolute;
  top: 17px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3182f6;
}

.agent-avatar::before { left: 13px; }
.agent-avatar::after { right: 13px; }

.agent-avatar i {
  width: 18px;
  height: 10px;
  margin-top: 9px;
  border: 2px solid #3182f6;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.agent-app-top strong {
  color: #191f28 !important;
  font-size: 19px !important;
  line-height: 1.15 !important;
}

.agent-app-top span:not(.agent-avatar) {
  color: #6b7684 !important;
  font-size: 13px !important;
  font-weight: 850 !important;
}

.agent-hero-card {
  display: grid !important;
  gap: 16px !important;
  padding: 20px 18px 18px !important;
  border: 1px solid #dfe6ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 14px 34px rgba(25, 31, 40, 0.05) !important;
}

.agent-hero-card .eyebrow {
  margin: 0 !important;
  color: #1b64da !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  text-transform: none !important;
}

.agent-hero-card h2 {
  margin: 0 !important;
  color: #191f28 !important;
  font-size: 25px !important;
  line-height: 1.28 !important;
  letter-spacing: 0 !important;
}

.agent-hero-card p:not(.eyebrow) {
  display: block !important;
  margin: 0 !important;
  color: #6b7684 !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
  font-weight: 700 !important;
}

.agent-sample-row {
  display: flex !important;
  gap: 8px !important;
  overflow-x: auto !important;
  padding: 2px 0 4px !important;
  scrollbar-width: none;
}

.agent-sample-row::-webkit-scrollbar {
  display: none;
}

.agent-sample-row button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 0 0 auto !important;
  min-height: 40px !important;
  padding: 0 14px !important;
  border: 1px solid #d8e1ec !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #191f28 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  box-shadow: 0 4px 12px rgba(25, 31, 40, 0.03) !important;
}

.agent-sample-row button span {
  color: #3182f6;
  font-size: 15px;
}

.agent-hero-progress {
  height: 4px;
  border-radius: 999px;
  background: #edf0f3;
  overflow: hidden;
}

.agent-hero-progress span {
  display: block;
  width: 46px;
  height: 100%;
  border-radius: inherit;
  background: #3182f6;
}

.agent-chat-card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 520px !important;
  height: auto !important;
  border: 1px solid #dfe6ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  overflow: hidden !important;
  box-shadow: 0 14px 34px rgba(25, 31, 40, 0.05) !important;
}

.agent-chat-status {
  min-height: 48px !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid #edf0f3 !important;
  background: #fff !important;
}

.agent-chat-status strong {
  font-size: 13px !important;
}

.agent-chat-status span {
  font-size: 11.5px !important;
}

.agent-message-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  min-height: 340px !important;
  max-height: none !important;
  flex: 1 1 auto !important;
  padding: 16px 14px !important;
  overflow-y: auto !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

.agent-message {
  display: grid !important;
  gap: 7px !important;
  max-width: 92% !important;
}

.agent-message span {
  color: #8b95a1 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

.agent-message p {
  margin: 0 !important;
  padding: 12px 13px !important;
  border: 1px solid #edf0f3 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #191f28 !important;
  font-size: 14px !important;
  line-height: 1.62 !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  box-shadow: 0 8px 18px rgba(25, 31, 40, 0.04) !important;
}

.agent-message.user {
  justify-self: end !important;
  align-self: flex-end !important;
  max-width: 82% !important;
}

.agent-message.user span {
  text-align: right !important;
}

.agent-message.user p {
  border: 0 !important;
  border-radius: 10px 10px 2px 10px !important;
  background: #3182f6 !important;
  color: #fff !important;
  font-size: 15px !important;
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.2) !important;
}

.agent-message.assistant p {
  border-radius: 10px 10px 10px 2px !important;
}

.agent-typing {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: fit-content !important;
  padding: 13px 14px !important;
  border: 1px solid #edf0f3 !important;
  border-radius: 10px 10px 10px 2px !important;
  background: #fff !important;
  box-shadow: 0 8px 18px rgba(25, 31, 40, 0.04) !important;
}

.agent-typing::before {
  content: "관련 PYM 자료를 먼저 찾는 중이에요. 잠시만 기다려주세요!";
  color: #191f28;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 750;
}

.agent-typing i {
  width: 5px !important;
  height: 5px !important;
}

.agent-references {
  display: grid !important;
  gap: 7px !important;
  width: 100% !important;
  padding: 11px !important;
  border: 1px solid #dfe6ee !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 8px 18px rgba(25, 31, 40, 0.035) !important;
}

.agent-references strong {
  color: #6b7684 !important;
  font-size: 13px !important;
  font-weight: 950 !important;
}

.agent-references button {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) 16px !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 42px !important;
  padding: 0 10px !important;
  border: 1px solid #dfe6ee !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #191f28 !important;
  text-align: left !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.agent-references button i {
  color: #6b7684;
  font-style: normal;
  font-size: 15px;
}

.agent-references button span {
  min-width: 0;
  overflow: hidden;
  color: #191f28 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px !important;
}

.agent-references button em {
  color: #8b95a1;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
}

.agent-input-form {
  position: sticky !important;
  bottom: 0 !important;
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr) 46px !important;
  align-items: end !important;
  gap: 8px !important;
  padding: 10px !important;
  border-top: 1px solid #edf0f3 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(14px) !important;
}

.agent-attach,
.agent-send {
  display: grid !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 50% !important;
  font-weight: 900 !important;
}

.agent-attach {
  width: 32px !important;
  height: 32px !important;
  margin-bottom: 4px !important;
  background: #f2f4f6 !important;
  color: #6b7684 !important;
  font-size: 15px !important;
}

.agent-send {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  background: #2478f7 !important;
  color: #fff !important;
  font-size: 18px !important;
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.28) !important;
}

.agent-input-box {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.agent-input-box textarea {
  width: 100% !important;
  min-height: 26px !important;
  max-height: 84px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #191f28 !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  outline: none !important;
}

.agent-input-box textarea::placeholder {
  color: #adb5bd;
}

.agent-input-box span {
  color: #adb5bd;
  font-size: 11px;
  font-weight: 750;
}

@media (max-height: 720px) {
  .agent-hero-card {
    padding: 15px !important;
  }

  .agent-hero-card h2 {
    font-size: 21px !important;
  }

  .agent-hero-card p:not(.eyebrow) {
    font-size: 13px !important;
  }

  .agent-chat-card {
    min-height: 470px !important;
  }

  .agent-message-list {
    min-height: 300px !important;
  }
}

/* Categorized PC admin center */
body.admin-mode #analyticsContent {
  display: block !important;
}

body.admin-mode .admin-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
}

body.admin-mode .admin-sidebar {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.06);
}

body.admin-mode .admin-sidebar-brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

body.admin-mode .admin-sidebar-brand > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #3182f6;
  color: #ffffff;
  font-size: 20px;
  font-weight: 950;
}

body.admin-mode .admin-sidebar-brand strong,
body.admin-mode .admin-sidebar-brand em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-mode .admin-sidebar-brand strong {
  color: #191f28;
  font-size: 16px;
  font-weight: 950;
}

body.admin-mode .admin-sidebar-brand em {
  margin-top: 2px;
  color: #8b95a1;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

body.admin-mode .admin-side-nav {
  display: grid;
  gap: 6px;
}

body.admin-mode .admin-side-nav a {
  display: grid;
  gap: 3px;
  min-height: 58px;
  justify-content: start;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

body.admin-mode .admin-side-nav a.active {
  border-color: #d7e8ff;
  background: #e8f3ff;
  box-shadow: inset 3px 0 0 #3182f6;
}

body.admin-mode .admin-side-nav strong {
  color: #191f28;
  font-size: 14px;
  font-weight: 950;
}

body.admin-mode .admin-side-nav span {
  color: #8b95a1;
  font-size: 11px;
  font-weight: 850;
}

body.admin-mode .admin-side-nav a.active strong,
body.admin-mode .admin-side-nav a.active span {
  color: #1b64da;
}

body.admin-mode .admin-workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

body.admin-mode .admin-section-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

body.admin-mode .admin-section-grid > .admin-card,
body.admin-mode .admin-section-grid > .premium-funnel-card,
body.admin-mode .admin-section-grid > .insight-card,
body.admin-mode .admin-section-grid > .premium-operating-card {
  grid-column: span 6;
  margin-top: 0;
}

body.admin-mode .admin-section-grid > .wide,
body.admin-mode .admin-section-grid > .admin-summary,
body.admin-mode .admin-section-grid > .bank-admin-card,
body.admin-mode .admin-section-grid > .admin-actions {
  grid-column: 1 / -1;
}

body.admin-mode .admin-section-grid > .admin-summary {
  margin: 0;
}

body.admin-mode .admin-section-grid .admin-actions.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

body.admin-mode .admin-section-grid .admin-actions.inline button {
  min-width: 160px;
  padding: 0 18px;
}

body.admin-mode .admin-toolbar {
  grid-template-columns: minmax(420px, 0.75fr) minmax(260px, 0.25fr);
  align-items: center;
}

body.admin-mode .admin-hero,
body.admin-mode .admin-toolbar,
body.admin-mode .admin-status {
  margin: 0;
}

body.admin-mode .admin-freshness-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  body.admin-mode .admin-shell {
    grid-template-columns: 220px minmax(920px, 1fr);
  }
}

@media (max-width: 900px) {
  body.admin-mode .admin-shell {
    grid-template-columns: 1fr;
  }

  body.admin-mode .admin-sidebar {
    position: static;
  }

  body.admin-mode .admin-side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body.admin-mode .admin-side-nav a {
    min-width: 132px;
  }

  body.admin-mode .admin-section-grid {
    grid-template-columns: 1fr !important;
  }

  body.admin-mode .admin-section-grid > .admin-card,
  body.admin-mode .admin-section-grid > .premium-funnel-card,
  body.admin-mode .admin-section-grid > .insight-card,
  body.admin-mode .admin-section-grid > .premium-operating-card,
  body.admin-mode .admin-section-grid > .bank-admin-card,
  body.admin-mode .admin-section-grid > .admin-summary,
  body.admin-mode .admin-section-grid > .admin-actions {
    grid-column: 1 / -1 !important;
  }

  body.admin-mode .admin-toolbar {
    grid-template-columns: 1fr;
  }
}
