/* Content Sorter 2000 — Mobile Experience v2
   Three states: welcome (0) → solo (1) → full (2+)
   Native-feeling, big fonts, smooth transitions. */

/* ── Only activate below 900px ────────────────────────────────────── */

@media (max-width: 899px) {

  /* ── Viewport ──────────────────────────────────────────────────── */

  html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
  }

  body {
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* ── Hide desktop elements ─────────────────────────────────────── */

  .cs-sidebar         { display: none !important; }
  .cs-view-tabs       { display: none !important; }
  .cs-detail-panel    { display: none !important; }
  .cs-faq-toggle      { display: none !important; }
  .cs-empty-state     { display: none !important; }
  .cs-solo-state      { display: none !important; }
  #waitlist-trigger    { display: none !important; }

  .cs-app {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
  }

  /* Hide the main desktop area — keep in DOM for SVG rendering */
  .cs-main {
    position: fixed;
    left: 0;
    top: -200vh;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    visibility: hidden;
  }

  /* But when a view is inside the mobile ranking chart, show it */
  .cs-m-ranking-chart .cs-view {
    visibility: visible;
  }

  /* ── Hidden utility ────────────────────────────────────────────── */

  .cs-m-hidden { display: none !important; }

  /* ================================================================
     MOBILE ROOT
     ================================================================ */

  .cs-m {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    background: var(--navy);
    overflow: hidden;
  }

  /* ================================================================
     WELCOME SCREEN (0 docs)
     ================================================================ */

  .cs-m-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    padding-top: calc(32px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cs-m-welcome-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
  }

  .cs-m-title {
    font-family: 'Trebuchet MS', Verdana, sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--hot-pink);
    letter-spacing: 1px;
    margin: 0;
    line-height: 1.2;
  }

  .cs-m-subtitle {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-dim);
    margin: 0;
  }

  .cs-m-samples-link {
    font-size: 15px;
    color: var(--teal);
    text-decoration: none;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .cs-m-samples-link:active {
    background: rgba(0, 204, 136, 0.08);
  }

  /* ================================================================
     SHARED: TEXTAREA
     ================================================================ */

  .cs-m-textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border-radius: 16px;
    border: 1.5px solid rgba(100, 140, 200, 0.2);
    background: var(--input-bg);
    color: var(--text);
    font-size: 17px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
  }

  .cs-m-textarea:focus {
    border-color: var(--hot-pink);
    box-shadow: 0 0 0 3px rgba(68, 136, 255, 0.12);
  }

  .cs-m-textarea::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
  }

  .cs-m-textarea-sm {
    min-height: 70px;
    font-size: 16px;
    padding: 14px;
    border-radius: 14px;
  }

  /* ================================================================
     SHARED: BUTTONS
     ================================================================ */

  .cs-m-btn {
    padding: 16px 28px;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s, opacity 0.2s;
    min-height: 54px;
    text-align: center;
  }

  .cs-m-btn:active {
    transform: scale(0.97);
  }

  .cs-m-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
  }

  .cs-m-btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: #fff;
    box-shadow: 0 4px 20px rgba(51, 102, 221, 0.3);
  }

  .cs-m-btn-danger {
    background: transparent;
    color: #ff5c5c;
    border: 1.5px solid rgba(255, 92, 92, 0.3);
  }

  .cs-m-btn-sm {
    padding: 12px 20px;
    font-size: 16px;
    min-height: 46px;
    border-radius: 12px;
  }

  /* ================================================================
     SHARED: STATUS
     ================================================================ */

  .cs-m-status {
    font-size: 15px;
    text-align: center;
    color: var(--text-dim);
    min-height: 20px;
    transition: color 0.2s;
  }

  .cs-m-status-success { color: var(--lime); }
  .cs-m-status-error   { color: #ff5c5c; }

  /* ================================================================
     SOLO SCREEN (1 doc)
     ================================================================ */

  .cs-m-solo {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    padding-top: calc(32px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cs-m-solo-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
  }

  .cs-m-solo-title {
    font-family: 'Trebuchet MS', Verdana, sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--hot-pink);
    margin: 0;
    text-align: center;
  }

  .cs-m-solo-card {
    background: var(--input-bg);
    border: 1.5px solid rgba(100, 140, 200, 0.15);
    border-radius: 14px;
    padding: 16px 18px;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  }

  .cs-m-solo-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(51, 102, 221, 0.15), rgba(100, 140, 200, 0.15));
    color: var(--hot-pink);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    font-family: 'Lucida Console', 'Menlo', monospace;
  }

  .cs-m-solo-msg {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-dim);
    text-align: center;
    margin: 0;
    padding: 0 8px;
  }

  /* ================================================================
     FULL SCREEN (2+ docs)
     ================================================================ */

  .cs-m-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* ── Top bar ─────────────────────────────────────────────────────── */

  .cs-m-topbar {
    display: flex;
    align-items: center;
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: 20px;
    padding-right: 8px;
    background: var(--panel);
    border-bottom: 1px solid rgba(100, 140, 200, 0.12);
    flex-shrink: 0;
    gap: 12px;
  }

  .cs-m-topbar-title {
    flex: 1;
    font-family: 'Trebuchet MS', Verdana, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--hot-pink);
    letter-spacing: 1px;
  }

  /* Hamburger */
  .cs-m-hamburger {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
  }

  .cs-m-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-dim);
    border-radius: 1px;
    transition: all 0.2s;
  }

  .cs-m-hamburger:active span {
    background: var(--hot-pink);
  }

  /* ── Tab content areas ─────────────────────────────────────────── */

  .cs-m-tab-posts,
  .cs-m-tab-ranking {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }

  /* ── Posts input area ───────────────────────────────────────────── */

  .cs-m-posts-input-area {
    display: flex;
    gap: 10px;
    padding: 14px 16px 0;
    flex-shrink: 0;
    align-items: flex-end;
  }

  .cs-m-posts-input-area .cs-m-textarea {
    flex: 1;
  }

  .cs-m-posts-input-area .cs-m-btn {
    flex-shrink: 0;
    align-self: flex-end;
  }

  .cs-m-tab-posts > .cs-m-status {
    padding: 4px 16px 0;
    font-size: 14px;
    min-height: 18px;
  }

  /* ── Sort strip ────────────────────────────────────────────────── */

  .cs-m-sort-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 16px;
    flex-shrink: 0;
    scrollbar-width: none;
  }

  .cs-m-sort-strip::-webkit-scrollbar { display: none; }

  .cs-m-sort-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(100, 140, 200, 0.15);
    background: transparent;
    color: var(--text-dim);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 36px;
    text-transform: capitalize;
  }

  .cs-m-sort-btn.active {
    background: linear-gradient(135deg, rgba(51, 102, 221, 0.12), rgba(100, 140, 200, 0.12));
    border-color: var(--hot-pink);
    color: var(--hot-pink);
  }

  .cs-m-sort-btn:active {
    transform: scale(0.95);
  }

  /* ── Posts list ─────────────────────────────────────────────────── */

  .cs-m-posts-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .cs-m-posts-list:empty::before {
    content: 'No posts yet';
    color: var(--text-dim);
    font-size: 16px;
    text-align: center;
    padding: 40px 0;
    opacity: 0.5;
  }

  /* Post item */
  .cs-m-post-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px 14px 14px;
    background: var(--input-bg);
    border: 1px solid rgba(100, 140, 200, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .cs-m-post-item:active {
    background: var(--surface);
    border-color: rgba(100, 140, 200, 0.25);
    transform: scale(0.99);
  }

  .cs-m-post-item.active {
    border-color: var(--hot-pink);
    background: rgba(68, 136, 255, 0.06);
  }

  /* Letter badge */
  .cs-m-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(51, 102, 221, 0.12), rgba(100, 140, 200, 0.12));
    color: var(--hot-pink);
    font-family: 'Lucida Console', 'Menlo', monospace;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
  }

  /* Grip */
  .cs-m-grip {
    font-size: 20px;
    color: var(--text-dim);
    opacity: 0.4;
    touch-action: none;
    flex-shrink: 0;
    padding: 4px;
  }

  /* Info */
  .cs-m-post-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .cs-m-post-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cs-m-post-hints {
    font-size: 13px;
    color: var(--lime);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Score */
  .cs-m-post-score {
    font-family: 'Lucida Console', 'Menlo', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--teal);
    flex-shrink: 0;
  }

  /* Chevron */
  .cs-m-post-chevron {
    font-size: 20px;
    color: var(--text-dim);
    opacity: 0.3;
    flex-shrink: 0;
  }

  /* Drag states */
  .cs-m-post-item.dragging {
    opacity: 0.9;
    transform: scale(1.02);
    background: var(--surface);
    border-color: var(--hot-pink);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 100;
    position: relative;
  }

  .cs-m-post-item.drop-above {
    box-shadow: 0 -3px 0 0 var(--hot-pink);
  }

  .cs-m-post-item.drop-below {
    box-shadow: 0 3px 0 0 var(--hot-pink);
  }

  /* ── Ranking tab ───────────────────────────────────────────────── */

  .cs-m-ranking-controls {
    padding: 12px 16px;
    flex-shrink: 0;
  }

  .cs-m-view-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid rgba(100, 140, 200, 0.2);
    background: var(--input-bg);
    color: var(--text);
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 500;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    outline: none;
  }

  .cs-m-view-select:focus {
    border-color: var(--hot-pink);
  }

  .cs-m-ranking-chart {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  /* Views inside ranking chart need to fill space */
  .cs-m-ranking-chart .cs-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
  }

  .cs-m-ranking-chart .cs-axis-controls {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 10;
    background: rgba(12, 0, 25, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(100, 140, 200, 0.1);
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
  }

  .cs-m-ranking-chart .cs-axis-controls .cs-label {
    font-size: 15px;
  }

  .cs-m-ranking-chart .cs-axis-controls .cs-select {
    font-size: 16px;
    padding: 10px 12px;
    min-height: 42px;
    border-radius: 10px;
  }

  .cs-m-ranking-chart .cs-quadrant-container,
  .cs-m-ranking-chart .cs-coaster-container,
  .cs-m-ranking-chart .cs-viz-container {
    flex: 1;
    min-height: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    max-height: none;
    width: 100%;
    aspect-ratio: auto;
  }

  .cs-m-ranking-chart .cs-viz-square {
    aspect-ratio: auto;
    align-self: stretch;
  }

  .cs-m-ranking-chart .cs-viz-wide {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cs-m-ranking-chart .cs-viz-wide::-webkit-scrollbar { display: none; }
  .cs-m-ranking-chart .cs-viz-wide svg {
    min-width: 140%;
    width: 140%;
    height: auto;
  }

  .cs-m-ranking-chart .cs-viz-scroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cs-m-ranking-chart .cs-viz-scroll svg {
    min-width: 120%;
    width: 120%;
  }

  /* ── Bottom tab bar ────────────────────────────────────────────── */

  .cs-m-tabbar {
    display: flex;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--panel);
    border-top: 1px solid rgba(100, 140, 200, 0.12);
    flex-shrink: 0;
  }

  .cs-m-tabbar-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    opacity: 0.5;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    padding: 8px 0;
  }

  .cs-m-tabbar-btn span {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
  }

  .cs-m-tabbar-btn svg {
    width: 22px;
    height: 22px;
  }

  .cs-m-tabbar-btn.active {
    color: var(--hot-pink);
    opacity: 1;
  }

  .cs-m-tabbar-btn:active {
    transform: scale(0.92);
  }

  /* ================================================================
     HAMBURGER MENU
     ================================================================ */

  .cs-m-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .cs-m-scrim.open {
    opacity: 1;
    pointer-events: auto;
  }

  .cs-m-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--panel);
    z-index: 1010;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .cs-m-menu.open {
    transform: translateX(0);
  }

  .cs-m-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(100, 140, 200, 0.1);
    font-family: 'Trebuchet MS', Verdana, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--hot-pink);
  }

  .cs-m-menu-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border-radius: 50%;
  }

  .cs-m-menu-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
  }

  .cs-m-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
    transition: background 0.15s;
  }

  .cs-m-menu-item:active {
    background: rgba(100, 140, 200, 0.08);
  }

  .cs-m-menu-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
  }

  .cs-m-menu-danger {
    color: #ff5c5c;
  }

  .cs-m-menu-divider {
    height: 1px;
    background: rgba(100, 140, 200, 0.1);
    margin: 8px 20px;
  }

  /* ================================================================
     DETAIL OVERLAY
     ================================================================ */

  .cs-m-detail {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }

  .cs-m-detail.open {
    transform: translateX(0);
  }

  .cs-m-detail-bar {
    display: flex;
    align-items: center;
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: 4px;
    padding-right: 16px;
    border-bottom: 1px solid rgba(100, 140, 200, 0.12);
    gap: 8px;
    flex-shrink: 0;
  }

  .cs-m-detail-back {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--teal);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  }

  .cs-m-detail-back:active {
    opacity: 0.6;
  }

  .cs-m-detail-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
  }

  .cs-m-detail-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    gap: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Hints */
  .cs-m-detail-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cs-m-hint-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(57, 255, 20, 0.08);
    border: 1px solid rgba(57, 255, 20, 0.2);
    color: var(--lime);
    font-size: 14px;
    font-weight: 500;
  }

  /* Score cards */
  .cs-m-detail-scores {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .cs-m-score-card {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .cs-m-score-label {
    width: 80px;
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--text-dim);
    flex-shrink: 0;
  }

  .cs-m-score-bar {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: rgba(100, 140, 200, 0.1);
    overflow: hidden;
  }

  .cs-m-score-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--pink), var(--teal));
    transition: width 0.4s ease;
  }

  .cs-m-score-value {
    width: 42px;
    font-family: 'Lucida Console', 'Menlo', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--teal);
    text-align: right;
    flex-shrink: 0;
  }

  /* Full text */
  .cs-m-detail-fulltext {
    border: 1px solid rgba(100, 140, 200, 0.12);
    border-radius: 14px;
    overflow: hidden;
  }

  .cs-m-detail-fulltext summary {
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dim);
    padding: 14px 16px;
    background: var(--input-bg);
  }

  .cs-m-detail-text {
    background: var(--input-bg);
    padding: 16px;
    font-size: 15px;
    line-height: 1.7;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-dim);
    -webkit-overflow-scrolling: touch;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    margin: 0;
  }

  /* Actions */
  .cs-m-detail-actions {
    padding-top: 4px;
    flex-shrink: 0;
  }

  .cs-m-detail-actions .cs-m-btn {
    width: 100%;
  }

  /* ================================================================
     FAQ — full-screen on mobile (reuse desktop panel)
     ================================================================ */

  .cs-faq-panel {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    z-index: 950 !important;
    border-radius: 0 !important;
  }

  /* ================================================================
     MODAL — mobile tweaks
     ================================================================ */

  .cs-modal {
    margin: 16px;
    max-height: calc(100vh - 32px);
    border-radius: 16px;
  }

  .cs-modal-input {
    font-size: 16px;
    min-height: 44px;
  }
}

/* ── Above 900px: hide all mobile elements ───────────────────────── */

@media (min-width: 900px) {
  .cs-m {
    display: none !important;
  }
}
