/* Shared RMR input shell. Do not edit in consumers; refresh from RMR - Chrome Extension. */
/* Tokens from ArT Reader - Engine (shared)/AGENT_brand-spec-for-build.md */
    #rmr-root {
      color-scheme: dark;

      --brand-gold: #FBBF24;
      --brand-gold-deep: #d59a12;
      --brand-gold-soft: #f1c75a;

      --overlay-title-inactive-background: rgba(251, 191, 36, 0.05);
      --overlay-title-shell-base: #1a1a1a;
      --overlay-title-text-color: rgba(251, 191, 36, 0.62);
      --overlay-title-background-color: var(--overlay-title-inactive-background);
      --overlay-title-active-background-color: color-mix(in srgb, var(--brand-gold) 62%, var(--overlay-title-shell-base) 38%);
      --overlay-title-active-text-color: color-mix(in srgb, var(--brand-gold) 5%, var(--overlay-title-shell-base) 95%);
      --overlay-title-active-background: var(--overlay-title-active-background-color);
      --overlay-title-filled-inactive-background: rgba(251, 191, 36, 0.05);

      --reader-selection-background: var(--overlay-title-filled-inactive-background);
      --reader-selection-text-color: var(--brand-gold);
      --reader-selection-border-color: rgba(251, 191, 36, 0.75);

      --overlay-focus-ring-color: rgba(251, 191, 36, 0.9);
      --overlay-focus-ring-width: 2px;
      --overlay-focus-ring-offset: -2px;

      --overlay-primary-action-active-text-color: #1a1a1a;
      --overlay-primary-action-active-border-color: #d59a12;
      --overlay-primary-action-active-background: linear-gradient(135deg, #d59a12 0%, #FBBF24 52%, #f1c75a 100%);
      --overlay-primary-action-active-background-hover: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-soft) 48%, #ffe29a 100%);
      --overlay-primary-action-active-shadow: 0 10px 24px rgba(213, 154, 18, 0.24);

      --input-dock-pill-border-color: rgba(255, 255, 255, 0.32);
      --input-dock-pill-background: rgba(255, 255, 255, 0.04);
      --input-dock-pill-text-color: rgba(255, 255, 255, 0.84);
      --input-dock-pill-hover-border-color: rgba(255, 255, 255, 0.62);
      --input-dock-pill-hover-background: rgba(255, 255, 255, 0.08);
      --input-dock-pill-hover-text-color: rgba(255, 255, 255, 0.96);
      --input-dock-pill-hover-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
      --input-dock-pill-toggle-active-background: transparent;
      --input-dock-pill-toggle-active-border-color: rgba(251, 191, 36, 0.75);
      --input-dock-pill-toggle-active-text-color: var(--brand-gold);
      --input-dock-pill-toggle-active-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);

      --input-text-color: var(--brand-gold);
      --input-placeholder-color: var(--input-text-color);

      --fullchunk-text-viewport-top-gap: 16px;
      --fullchunk-text-viewport-bottom-gap: 32px;
      --reader-text-viewport-side-gap: 12px;
      --overlay-title-font-size: 13px;
      --fullchunkdisplay-font-size: 15px;
      --pageview-text-viewport-top-gap: 20px;
      --pageview-text-viewport-bottom-gap: 16px;
      --pageviewmode-font-size: 22px;
      --pageviewmode-font-size-min: 14px;
      --pageviewmode-font-size-max: 28px;
      --fullchunkdisplay-font-size-min: 12px;
      --fullchunkdisplay-font-size-max: 18px;

      --overlay-width: 100%;
      --overlay-max-width: none;
      --overlay-top-offset: 0px;
      --overlay-shell-anchor-top: 0px;
      --overlay-shell-height: 100%;
      --overlay-spacing: 12px;
      --overlay-shell-padding-top: 16px;
      --overlay-shell-padding-inline: 12px;
      --overlay-shell-padding-bottom: 12px;
      --overlay-border-radius: 12px;
      --overlay-hero-button-font-size: 14px;
      --overlay-hero-button-min-height: 56px;
      --overlay-primary-action-width: 120px;
      --overlay-primary-action-min-height: 56px;
      --overlay-button-label-scale: 1.25;

      --overlay-glass: rgba(26, 26, 26, 0.92);
      --overlay-glass-border: rgba(107, 114, 128, 0.3);
      --overlay-radius: 12px;
      --overlay-text: #e5e7eb;
      --overlay-text-muted: #9ca3af;
      --overlay-text-faint: rgba(255, 255, 255, 0.4);

      --tier-post: var(--brand-gold);
      --tier-comments: var(--brand-gold-deep);
      --tier-replies: var(--brand-gold-soft);
      --tier-nested: rgba(255, 255, 255, 0.55);
      --tier-track-background: rgba(255, 255, 255, 0.08);
    }

    .panel {
      position: relative;
      z-index: 2147483000;
      isolation: isolate;
      display: flex;
      flex-direction: column;
      gap: 14px;
      flex: 1;
      min-height: 0;
    }

    .muted { color: var(--overlay-text-muted); }
    .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .extension-entry,
    .web-entry { display: none !important; }
    html[data-rmr-platform="extension"] .extension-entry { display: block !important; }
    html[data-rmr-platform="extension"] .session-status.extension-entry { display: none !important; }
    html[data-rmr-platform="extension"] .off-reddit-gate.extension-entry,
    html[data-rmr-platform="extension"] .login-required-gate.extension-entry,
    html[data-rmr-platform="extension"] .need-thread-gate.extension-entry { display: none !important; }
    html[data-rmr-platform="extension"] .panel.is-off-reddit .off-reddit-gate.extension-entry,
    html[data-rmr-platform="extension"] .panel.is-login-required .login-required-gate.extension-entry,
    html[data-rmr-platform="extension"] .panel.is-need-thread .need-thread-gate.extension-entry { display: flex !important; }
    html[data-rmr-platform="web"] .web-entry { display: block !important; }
    html[data-rmr-platform="web"] .thread-url-label.web-entry,
    html[data-rmr-platform="web"] .thread-url-input.web-entry { display: none !important; }

    .thread-url-label {
      font-size: 12px;
      font-weight: 700;
      color: var(--overlay-text-muted);
      margin-bottom: 6px;
    }
    .thread-url-input {
      width: 100%;
      margin: 0 0 10px;
      padding: 10px 12px;
      border: 1px solid var(--input-dock-pill-border-color);
      border-radius: 10px;
      background: var(--input-dock-pill-background);
      color: var(--brand-gold);
      font: inherit;
      font-size: 13px;
    }
    .thread-url-input::placeholder { color: var(--input-placeholder-color); opacity: 0.7; }
    .thread-url-input:focus {
      outline: none;
      border-color: var(--overlay-focus-ring-color);
      box-shadow: 0 0 0 var(--overlay-focus-ring-width) rgba(251, 191, 36, 0.18);
    }

    .thread-subreddit { font-size: 12px; font-weight: 700; color: var(--overlay-text-muted); margin-bottom: 5px; }
    .thread-title { font-size: 15px; font-weight: 400; letter-spacing: -0.01em; color: var(--brand-gold); }

    .session-status {
      display: none;
    }

    .panel.is-off-reddit .input-body,
    .panel.is-off-reddit .footer-row,
    .panel.is-login-required .input-body,
    .panel.is-login-required .footer-row,
    .panel.is-need-thread .input-body,
    .panel.is-need-thread .footer-row {
      pointer-events: none;
      user-select: none;
      opacity: 0.45;
    }
    .off-reddit-gate,
    .login-required-gate,
    .need-thread-gate { display: none; flex-direction: column; gap: 10px; }
    .panel.is-off-reddit .off-reddit-gate { display: flex; }
    .panel.is-login-required .login-required-gate { display: flex; }
    .panel.is-need-thread .need-thread-gate { display: flex; }
    .panel.is-off-reddit #threadMeta,
    .panel.is-login-required #threadMeta,
    .panel.is-need-thread #threadMeta { display: none; }
    html[data-rmr-platform="web"] .panel.is-need-thread .input-body,
    html[data-rmr-platform="web"] .panel.is-need-thread .footer-row {
      pointer-events: auto;
      user-select: auto;
      opacity: 1;
    }
    html[data-rmr-platform="web"] .panel.is-need-thread #screen-input,
    html[data-rmr-platform="web"] .panel.is-need-thread .reset-btn { display: none !important; }
    html[data-rmr-platform="web"] .panel:not(.is-need-thread) #pasteDock,
    html[data-rmr-platform="web"] .panel:not(.is-need-thread) .rmr-input-brand { display: none !important; }
    html[data-rmr-platform="web"] .panel.is-need-thread .need-thread-gate.has-error { display: flex !important; }
    .off-reddit-gate p,
    .login-required-gate p,
    .need-thread-gate p {
      margin: 0;
      font-size: 15px;
      font-weight: 700;
      color: var(--overlay-text);
      line-height: 1.35;
    }
    .off-reddit-gate a,
    .login-required-gate a,
    .need-thread-gate a {
      color: var(--brand-gold);
      font-weight: 700;
      font-size: 14px;
      text-decoration: none;
    }
    .off-reddit-gate a:hover,
    .login-required-gate a:hover,
    .need-thread-gate a:hover { text-decoration: underline; color: var(--brand-gold-soft); }
    .thread-title.is-error { color: var(--brand-gold-deep); white-space: normal; }

    .card {
      background: var(--overlay-glass);
      border: 1px solid var(--overlay-glass-border);
      border-radius: var(--overlay-radius);
      padding: 16px;
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }

    .section-divider { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--overlay-glass-border); }

    .glance-stats {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      gap: 12px;
      min-height: 0;
      padding: 0;
    }
    .glance-stats[hidden] { display: none !important; }
    .glance-stat {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: center;
      column-gap: 10px;
      row-gap: 8px;
      width: 148px;
      min-width: 148px;
      min-height: 0;
      padding: 12px 14px 14px;
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-left: 3px solid rgba(220, 220, 220, 0.55);
      border-radius: 8px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.22));
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
    .glance-stat-count {
      font-size: 40px;
      font-weight: 700;
      line-height: 0.92;
      letter-spacing: 0.02em;
      color: #e6e6e6;
      font-variant-numeric: tabular-nums;
      text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.92),
        0 2px 6px rgba(0, 0, 0, 0.7),
        0 0 16px rgba(230, 230, 230, 0.28);
    }
    .glance-stat-label {
      grid-column: 1 / -1;
      margin: 0;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.14em;
      line-height: 1.2;
      text-transform: uppercase;
      color: #c8c8c8;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 10px rgba(200, 200, 200, 0.18);
    }
    .glance-stat.is-empty {
      min-width: 148px;
    }
    .glance-stat.is-empty .glance-stat-label {
      grid-column: 2;
      grid-row: 1;
    }
    .glance-stat-glyph {
      width: 34px;
      height: 34px;
      overflow: visible;
      color: #d8d8d8;
      filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(220, 220, 220, 0.22));
    }
    .glance-stat-glyph * {
      fill: none;
      stroke: currentColor;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-width: 1.8;
    }

    .primary-btn {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 13px 16px;
      border: 1px solid var(--overlay-primary-action-active-border-color);
      border-radius: 10px;
      background: var(--overlay-primary-action-active-background);
      color: var(--overlay-primary-action-active-text-color);
      font: inherit;
      font-weight: 600;
      font-size: 14px;
      cursor: pointer;
      box-shadow: var(--overlay-primary-action-active-shadow);
    }
    #generateAudioBtn.primary-btn {
      flex: 1 1 auto;
      min-height: 88px;
      max-height: 148px;
      padding-block: 26px;
      font-size: 16px;
    }
    .primary-btn:hover { background: var(--overlay-primary-action-active-background-hover); }
    .primary-btn:focus {
      outline: none;
      box-shadow: 0 0 0 var(--overlay-focus-ring-width) var(--overlay-focus-ring-color);
    }
    .primary-btn:disabled { cursor: default; opacity: 0.3; pointer-events: none; }

    .reset-btn {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 4px 10px;
      border: 1px solid var(--overlay-glass-border);
      border-radius: 10px;
      background: transparent;
      color: var(--overlay-text-muted);
      font: inherit;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
    }
    .reset-btn:hover { color: var(--overlay-text); border-color: var(--input-dock-pill-hover-border-color); }
    .reset-btn:focus {
      outline: none;
      box-shadow: 0 0 0 var(--overlay-focus-ring-width) var(--overlay-focus-ring-color);
    }

    .limit-steppers { display: flex; flex-direction: column; gap: 10px; }
    .ama-limits { display: flex; flex-direction: column; gap: 10px; }
    .deep-exchanges {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }
    .pill-group {
      display: flex;
      flex: none;
      border: 1px solid var(--input-dock-pill-border-color);
      border-radius: 999px;
      overflow: hidden;
      background: var(--input-dock-pill-background);
    }
    .pill-group input[type="radio"] { display: none; }
    .pill-group label {
      padding: 8px 12px;
      font-size: 12.5px;
      font-weight: 500;
      cursor: pointer;
      color: var(--input-dock-pill-text-color);
      border-right: 1px solid rgba(255, 255, 255, 0.14);
      user-select: none;
      white-space: nowrap;
    }
    .pill-group label:last-child { border-right: none; }
    .pill-group input[type="radio"]:checked + label {
      background: var(--overlay-title-filled-inactive-background);
      color: var(--reader-selection-text-color);
      box-shadow: inset 0 0 0 1px var(--reader-selection-border-color);
    }
    .limit-stepper { display: flex; flex-direction: column; gap: 6px; }
    .limit-stepper-row {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      align-items: center;
      justify-items: center;
      width: 100%;
    }
    .limit-stepper-btn {
      justify-self: stretch;
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-width: 0;
      height: 72px;
      min-height: 72px;
      padding: 0;
      border: none;
      background: transparent;
      color: var(--overlay-text);
      font: inherit;
      line-height: 1;
      cursor: pointer;
      touch-action: manipulation;
      user-select: none;
    }
    .limit-stepper-btn::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 72px;
      height: 72px;
      transform: translate(-50%, -50%);
      border: 1px solid var(--overlay-glass-border);
      border-radius: 10px;
      background: var(--input-dock-pill-background);
      pointer-events: none;
    }
    .limit-stepper-btn svg { position: relative; z-index: 1; display: block; }
    .limit-stepper-btn:hover:not(:disabled)::before {
      border-color: var(--input-dock-pill-hover-border-color);
      background: var(--input-dock-pill-hover-background);
    }
    .limit-stepper-btn:focus {
      outline: none;
    }
    .limit-stepper-btn:focus::before {
      box-shadow: 0 0 0 var(--overlay-focus-ring-width) var(--overlay-focus-ring-color);
    }
    .limit-stepper-btn:disabled {
      opacity: 0.3;
      cursor: default;
      pointer-events: none;
    }

    input.eq-value-input {
      flex: none;
      width: 3ch;
      height: 72px;
      min-height: 72px;
      padding: 0;
      border: 1px solid transparent;
      border-radius: 10px;
      background: transparent;
      text-align: center;
      font-size: 48px;
      font-weight: 700;
      line-height: 0.95;
      color: var(--brand-gold);
      letter-spacing: -0.02em;
      font-variant-numeric: tabular-nums;
      -moz-appearance: textfield;
    }
    input.eq-value-input::-webkit-inner-spin-button,
    input.eq-value-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
    input.eq-value-input:focus {
      outline: none;
      border-color: var(--overlay-focus-ring-color);
      box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.12);
      background: var(--overlay-title-shell-base);
    }
    #listenLimit.eq-value-input {
      width: 5ch;
      font-size: clamp(40px, 12vw, 64px);
    }
    #listenLimit.eq-value-input:focus {
      border-color: transparent;
      box-shadow: none;
      background: transparent;
    }

    .eq-label {
      display: inline-block;
      font-size: 13px;
      font-weight: 600;
      color: var(--overlay-text-muted);
      border-bottom: 2px solid transparent;
      width: fit-content;
    }
    #listenLimitEqLabel { border-bottom-color: color-mix(in srgb, var(--tier-comments) 15%, transparent); }

    .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px; font-size: 12px; }
    .footer-row .muted { display: flex; align-items: center; gap: 6px; }

    .rmr-input-brand {
      font-size: var(--overlay-title-font-size, 13px);
      font-weight: 400;
      letter-spacing: 0.04em;
      color: var(--overlay-title-text-color);
      margin: 0 0 12px;
    }
    #pasteDock {
      flex: 0 0 auto;
      margin-top: auto;
      padding-top: 14px;
    }
    #pasteThreadBtn {
      width: 100%;
      min-height: clamp(128px, 22dvh, 192px);
      font-size: 18px;
    }
    #pasteThreadBtn .btn-label {
      font-size: 18px;
      font-weight: 600;
      letter-spacing: 0.02em;
    }

    .input-overlay {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .input-overlay[hidden],
    .footer-row[hidden],
    .panel.is-returns-open .input-overlay,
    .panel.is-returns-open .footer-row {
      display: none !important;
    }
    .input-top {
      flex: 0 0 auto;
    }
    .input-body,
    #screen-input {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
    }
    .selection-unit {
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
      justify-content: safe center;
      gap: 50px;
      min-height: 0;
      overflow: auto;
    }
    .selection-controls {
      flex: 0 0 auto;
    }
    .input-hero-dock {
      flex: 0 1 148px;
      display: flex;
      flex-direction: column;
      min-height: 88px;
      margin-top: auto;
    }
    #returns-overlay-host {
      display: none;
      flex: 1;
      min-height: 0;
      position: relative;
    }
    #returns-overlay-host.is-open { display: block; }
    #returns-overlay-host .builtin-overlay,
    #returns-overlay-host .builtin-overlay[data-active-view="loading"],
    #returns-overlay-host .builtin-overlay[data-active-view="fullchunk"],
    #returns-overlay-host .builtin-overlay[data-active-view="pageview"] {
      top: 0;
      height: 100%;
      min-height: 0;
      max-height: 100%;
      width: 100%;
    }

    /* Narrow side panel: subreddit on line 1, full title on line 2, both left-aligned. */
    #returns-overlay-host .overlay-header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: start;
      column-gap: 8px;
      row-gap: 4px;
    }
    #returns-overlay-host .header-left {
      grid-column: 1;
      grid-row: 1;
      flex-direction: column;
      align-items: flex-start;
      justify-content: flex-start;
      gap: 0;
      min-width: 0;
    }
    #returns-overlay-host .header-center {
      display: none !important;
    }
    #returns-overlay-host .header-right {
      grid-column: 2;
      grid-row: 1;
      align-items: flex-start;
    }
    #returns-overlay-host .overlay-title-static {
      overflow: visible;
      text-overflow: unset;
      white-space: normal;
      text-align: left;
      width: 100%;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.3;
      color: var(--overlay-text-muted);
      margin-bottom: 5px;
    }
    #returns-overlay-host #loadBtn {
      display: none !important;
    }
    #returns-overlay-host .rmr-overlay-title {
      display: block;
      width: 100%;
      margin: 0;
      padding: 0;
      color: var(--brand-gold);
      font-size: var(--overlay-title-font-size, 13px);
      font-weight: 400;
      line-height: 1.3;
      letter-spacing: -0.01em;
      text-align: left;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
    }
    #returns-overlay-host .rmr-overlay-title[hidden] {
      display: none;
    }
    #returns-overlay-host .header-title-readout {
      display: none !important;
    }

    /* Playback: vertically center the page in the remaining viewport. */
    #returns-overlay-host .builtin-overlay[data-active-view="pageview"] .overlay-content,
    #returns-overlay-host .builtin-overlay[data-active-view="pageview"] .overlay-body,
    #returns-overlay-host .builtin-overlay[data-active-view="pageview"] .overlay-main,
    #returns-overlay-host .builtin-overlay[data-active-view="pageview"] #pageView {
      height: 100%;
      min-height: 0;
    }
    #returns-overlay-host #pageViewDisplay {
      justify-content: center;
    }
    #returns-overlay-host #pageViewDisplay .text-content {
      justify-content: center;
    }

    /* No name-your-art field. Post title is committed in the header. */
    #returns-overlay-host #loadingTitleRow,
    #returns-overlay-host #titleRowHint,
    #returns-overlay-host .loading-autoplay-toggle,
    #returns-overlay-host .builtin-overlay[data-active-view="loading"] .overlay-progress-row {
      display: none !important;
    }

    /* Loading: countdown sits in the leftover viewport, vertically centered. */
    #returns-overlay-host .builtin-overlay[data-active-view="loading"] {
      grid-template-rows: auto minmax(0, 1fr);
    }
    #returns-overlay-host .builtin-overlay[data-active-view="loading"] .overlay-content {
      grid-row: 2;
      height: 100%;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    #returns-overlay-host .builtin-overlay[data-active-view="loading"] .overlay-body,
    #returns-overlay-host .builtin-overlay[data-active-view="loading"] .overlay-main,
    #returns-overlay-host .builtin-overlay[data-active-view="loading"] .view-panel,
    #returns-overlay-host .builtin-overlay[data-active-view="loading"] #loadingInterface {
      height: 100%;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    #consoleErrorNotice {
      color: var(--brand-gold-deep);
      font-size: 12px;
    }
    #generationError {
      margin-top: 10px;
      color: var(--brand-gold-deep);
      font-size: 12px;
      line-height: 1.4;
    }
