.ltma-standalone-root,
body.ltma-standalone {
  background: #171319;
}

.ltma-status-bar-shield {
  position: fixed;
  z-index: 2147483646;
  top: 0;
  right: 0;
  left: 0;
  height: 8px;
  background: #171319;
  pointer-events: none;
}

body.ltma-standalone .ltma-header {
  padding-top: 8px;
}

.ltma-standalone,
.ltma-standalone body,
.ltma-app {
  touch-action: manipulation;
}

.ltma-app-name {
  display: inline-flex;
  align-items: center;
  padding: 0;
}

.ltma-header-logo {
  display: block;
  width: auto;
  height: 46px;
}

.ltma-account-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.ltma-account-button.has-handle svg {
  display: none;
}

.ltma-account-button [data-ltma-account-initial] {
  font-weight: 700;
}

.ltma-font-overlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #0009;
}

.ltma-font-overlay[hidden] {
  display: none;
}

.ltma-font-dialog {
  width: min(320px, 100%);
  padding: 22px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 30px 100px #0006;
}

.ltma-font-dialog h2 {
  margin: 0 32px 18px 0;
  font-size: 20px;
}

.ltma-font-dialog label,
.ltma-font-dialog select {
  display: block;
  width: 100%;
}

.ltma-font-dialog select {
  margin-top: 7px;
  padding: 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
}

.ltma-font-close {
  float: right;
  padding: 0;
  color: var(--ink);
  border: 0;
  background: transparent;
  font-size: 26px;
}

.ltma-story-info-dialog {
  font-size: 13px;
  line-height: 1.4;
}

.ltma-story-info-dialog h2 {
  font-size: 18px;
}

.ltma-story-info-dialog dt {
  margin-top: 10px;
  font-weight: 700;
}

.ltma-story-info-dialog dd {
  margin: 3px 0 0;
  line-height: 1.5;
}

.ltma-info-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.ltma-info-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 7px 5px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  line-height: 1.2;
  white-space: nowrap;
}

.ltma-info-tag button {
  display: grid;
  width: 22px;
  height: 22px;
  flex: none;
  place-items: center;
  padding: 0;
  color: var(--accent);
  border: 0;
  background: transparent;
}

.ltma-info-tag > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 799px) {
  .ltma-nav {
    grid-template-columns: repeat(var(--ltma-tab-count, 5), minmax(0, 64px));
    justify-content: center;
    padding-right: max(22px, env(safe-area-inset-right));
    padding-left: max(22px, env(safe-area-inset-left));
  }
}

.ltma-nav:empty {
  display: none;
}

[data-ltma-discover][data-view="home"] .ltma-favorites-page,
[data-ltma-discover][data-view="favorites"] section:not(.ltma-favorites-page) {
  display: none;
}

/* Every bottom-navigation destination owns one page. */
[data-ltma-discover] > section {
  display: none !important;
}

[data-ltma-discover][data-view="home"] > .ltma-home-page,
[data-ltma-discover][data-view="search"] > .ltma-search-page,
[data-ltma-discover][data-view="tbr"] > .ltma-to-be-read-page,
[data-ltma-discover][data-view="favorites"] > .ltma-favorites-page,
[data-ltma-discover][data-view="library"] > .ltma-library-page,
[data-ltma-discover][data-view="discover"] > .ltma-recommendations-page,
[data-ltma-discover][data-view="audio"] > .ltma-recommendations-page,
[data-ltma-discover][data-view="history"] > .ltma-history-page,
[data-ltma-discover][data-view="mp3"] > .ltma-mp3-page,
[data-ltma-discover][data-view="tags"] > .ltma-favorite-tags-page {
  display: block !important;
}

.ltma-library-menu {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ltma-mp3-list {
  display: grid;
  gap: 12px;
}

.ltma-mp3-track {
  display: flex;
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-align: left;
  font: 750 15px/1.35 Inter, ui-sans-serif, system-ui, sans-serif;
}

.ltma-mp3-track svg {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  fill: var(--accent);
}

.ltma-mp3-track > span {
  display: grid;
  gap: 4px;
}

.ltma-mp3-track strong { font: inherit; }

.ltma-mp3-track small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.ltma-mp3-player {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 72px 24px calc(32px + env(safe-area-inset-bottom));
  color: #fff;
  background: #121016;
}

.ltma-mp3-player[hidden] { display: none; }

.ltma-mp3-player > div {
  width: min(100%, 680px);
  text-align: center;
}

.ltma-mp3-player h2 {
  position: absolute;
  right: 22px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  left: 22px;
  margin: 0;
  overflow: hidden;
  color: rgba(255,255,255,.5);
  font: 500 9px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ltma-mp3-duration {
  margin: 0 0 18px;
  color: rgba(255,255,255,.72);
  font: 600 14px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}

.ltma-mp3-player audio { width: 100%; }

.ltma-mp3-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  font-size: 34px;
  line-height: 1;
}

.ltma-search-results {
  min-height: 120px;
}

.ltma-home-page > .ltma-section-head:not(:first-child) {
  margin-top: 28px;
}

.ltma-home-continue,
.ltma-home-to-be-read,
.ltma-home-recent {
  display: grid;
  gap: 12px;
}

.ltma-home-continue .story-card .chips {
  display: none;
}

.ltma-home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ltma-stat-added {
  position: relative;
  grid-column: 1 / -1;
  min-height: 104px;
  overflow: hidden;
  isolation: isolate;
}

.ltma-stat-added > strong,
.ltma-stat-added > span,
.ltma-stat-added > small {
  position: relative;
  z-index: 1;
}

.ltma-stat-period {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .02em;
}

.ltma-stat-area {
  position: absolute;
  inset: 8px 0 0;
  z-index: 0;
  width: 100%;
  height: calc(100% - 8px);
  color: var(--accent);
  pointer-events: none;
}

.ltma-stat-area-fill {
  fill: currentColor;
  opacity: .09;
}

.ltma-stat-area-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  opacity: .18;
}

.ltma-stat-area-points {
  display: none;
}

.ltma-history-handle {
    margin: -6px 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.ltma-load-more[hidden] {
    display: none !important;
}

.ltma-search-status {
    grid-column: 1 / -1;
    margin: 0;
    padding: 8px 2px;
    color: var(--muted);
    font-size: 12px;
}

.ltma-history-stories {
    display: block;
}

.ltma-activity-row {
    display: grid;
    grid-template-columns: minmax(138px, 180px) minmax(0, 1fr);
    gap: 18px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
}

.ltma-activity-row time {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.ltma-activity-row > div {
    display: grid;
    grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
    align-items: baseline;
    gap: 6px 14px;
}

.ltma-activity-row strong {
    font-size: 13px;
}

.ltma-activity-row button {
    min-width: 0;
    padding: 0;
    overflow: hidden;
    color: var(--accent);
    border: 0;
    background: none;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.ltma-activity-row small {
    grid-column: 2;
    color: var(--muted);
}

@media (max-width: 640px) {
    .ltma-home-stats {
        grid-template-columns: 1fr;
    }

    .ltma-stat-added {
        grid-column: auto;
    }

    .ltma-activity-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .ltma-activity-row > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .ltma-activity-row small {
        grid-column: 1;
    }
}

.ltma-stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.ltma-stat-card > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 32px;
  line-height: 1;
}

.ltma-stat-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
}

.ltma-stat-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ltma-stat-card li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ltma-stat-card li strong {
  color: var(--muted);
}

.ltma-reader-bar button.on {
  color: var(--accent);
}

.ltma-stat-link {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--accent);
  border: 0;
  background: transparent;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}


.ltma-see-all {
  padding: 6px 0;
  color: var(--accent);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.ltma-library-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ltma-library-menu button {
  display: grid;
  min-height: 120px;
  place-items: center;
  gap: 8px;
  padding: 18px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  cursor: pointer;
}

.ltma-library-menu svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

@media (min-width: 800px) {
  .ltma-home-to-be-read,
  .ltma-home-recent {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 800px) {
  .ltma-nav {
    grid-template-rows: repeat(var(--ltma-tab-count, 7), 72px);
  }
}

.tag-row {
  content-visibility: auto;
  contain-intrinsic-size: 48px;
}

.ltma-additional-tags-head {
  margin-top: 28px;
}

.ltma-tag-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.ltma-tag-group .tag-row:last-child {
  border-bottom: 0;
}

@media (min-width: 800px) {
  .ltma-nav {
    grid-template-rows: repeat(var(--ltma-tab-count, 6), 72px);
  }
}

[data-ltma-reader-content] > .page-head,
[data-ltma-reader-content] > .story-list {
  width: min(1100px, 100%);
  margin-right: auto;
  margin-left: auto;
  padding-right: clamp(14px, 3vw, 32px);
  padding-left: clamp(14px, 3vw, 32px);
}

[data-ltma-reader-content] > .story-list {
  padding-bottom: 80px;
}

.ltma-app.is-list-page .ltma-reader-bar {
  display: none;
}

.ltma-app.is-list-page [data-ltma-reader-content] {
  padding-top: 0;
}

.download-status {
  position: absolute;
  right: 52px;
  bottom: 17px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.download-icon.is-preparing {
  opacity: 0.65;
}

.ltma-reader-fullscreen {
  margin-left: auto;
}

.ltma-reader-bar button {
  display: grid;
  place-items: center;
  align-self: center;
}

.ltma-info-button svg,
.story-card [data-a="info"] svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.story-card [data-a="tbr"] svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.story-card .story-metadata {
  width: 100%;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ltma-to-be-read-stories {
  display: grid;
  gap: 12px;
}

@media (min-width: 800px) {
  .ltma-to-be-read-stories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ltma-reader-fullscreen .ltma-fullscreen-exit {
  display: none;
}

.ltma-app.is-reader-fullscreen .ltma-header,
.ltma-app.is-reader-fullscreen .ltma-nav {
  display: none;
}

.ltma-app.is-reader-fullscreen .ltma-reader {
  inset: 0;
}

.ltma-app.is-reader-fullscreen .ltma-reader-bar {
  padding-top: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  transition: opacity 150ms ease, transform 150ms ease;
}

.ltma-app.is-reader-fullscreen [data-ltma-reader-content] {
  padding-top: 12px;
}

.ltma-app.is-reader-fullscreen.is-reader-toolbar-visible .ltma-reader-bar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ltma-app.is-reader-fullscreen .ltma-fullscreen-enter {
  display: none;
}

.ltma-app.is-reader-fullscreen .ltma-fullscreen-exit {
  display: block;
}

@media (min-width: 800px) {
  .ltma-app.is-reader-fullscreen .ltma-reader {
    left: 0;
  }
}

.story-card .story-author,
.story-card p,
.story-card small {
  font-size: 16.5px;
  line-height: 1.4;
}

.story-card .ranking-score {
  position: absolute;
  right: 52px;
  bottom: 17px;
  left: 16px;
  width: auto;
  margin: 0;
  padding: 0;
}

.story-card:has(.ranking-score) {
  padding-bottom: 58px;
}

.story-card small {
  position: static;
  display: block;
  width: calc(100% - 40px);
  max-width: none;
  margin: 10px 0 0;
  padding-top: 8px;
  font-size: 10px;
  line-height: 1.3;
}

.ltma-profile-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.ltma-profile-gate[hidden] {
  display: none;
}

.ltma-profile-gate-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  text-align: center;
}

.ltma-profile-gate-card h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 7vw, 42px);
}

.ltma-profile-gate-card input {
  width: 100%;
  padding: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 18px;
  text-align: center;
  letter-spacing: .08em;
}

.ltma-profile-gate-card button {
  padding: 13px 18px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.ltma-profile-gate-card button:disabled {
  opacity: .6;
}

.ltma-profile-gate-card .ltma-account-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
}

.ltma-profile-gate-card .ltma-account-status.is-error {
  color: #c33;
}

/* Keep fixed app surfaces below the WordPress toolbar for logged-in viewers. */
body.admin-bar .ltma-header {
  top: 32px;
}

body.admin-bar .ltma-reader {
  top: 96px;
}

body.admin-bar .ltma-profile-gate {
  top: 32px;
}

body.admin-bar .ltma-app.is-reader-fullscreen .ltma-reader {
  top: 32px;
}

@media (min-width: 800px) {
  body.admin-bar .ltma-nav {
    top: 96px;
  }
}

@media (max-width: 782px) {
  body.admin-bar .ltma-header {
    top: 46px;
  }

  body.admin-bar .ltma-reader {
    top: 110px;
  }

  body.admin-bar .ltma-profile-gate,
  body.admin-bar .ltma-app.is-reader-fullscreen .ltma-reader {
    top: 46px;
  }
}

/* Story preference actions: heart = Favorite, books = Bookshelf, X = dismiss. */
.story-card [data-a="fav"],
[data-ltma-story-favorite] {
  font-size: 0 !important;
}

.story-card [data-a="fav"] > svg {
  display: none;
}

.story-card [data-a="fav"]::before,
[data-ltma-story-favorite]::before {
  display: block;
  width: 22px;
  height: 22px;
  background: currentColor;
  content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21S3 15.6 3 8.7C3 5.5 5.4 3 8.5 3c1.7 0 3.1.8 3.5 2 .4-1.2 1.8-2 3.5-2C18.6 3 21 5.5 21 8.7 21 15.6 12 21 12 21Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21S3 15.6 3 8.7C3 5.5 5.4 3 8.5 3c1.7 0 3.1.8 3.5 2 .4-1.2 1.8-2 3.5-2C18.6 3 21 5.5 21 8.7 21 15.6 12 21 12 21Z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .68;
  transition: opacity .15s ease, transform .15s ease;
}

.story-card [data-a="fav"].on::before,
[data-ltma-story-favorite].on::before,
.story-card [data-a="fav"]:hover::before,
.story-card [data-a="fav"]:focus-visible::before,
[data-ltma-story-favorite]:hover::before,
[data-ltma-story-favorite]:focus-visible::before {
  opacity: 1;
}

.story-card [data-a="fav"]:active::before,
[data-ltma-story-favorite]:active::before {
  transform: scale(.92);
}

.story-card .ltma-dismiss-x {
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.story-card [data-a="tbr"] > svg,
[data-ltma-story-flagged] > svg {
  display: none;
}

.story-card [data-a="tbr"]::before,
[data-ltma-story-flagged]::before {
  display: block;
  width: 22px;
  height: 22px;
  background: currentColor;
  content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.2 4.4 11 1.2c.6-.3 1.3-.3 1.9 0l6 2.7c.8.4.9 1.4.2 1.9l-6.2 4.4c-.6.4-1.3.5-2 .1L5 7.5c-1.4-.7-1.3-2.3.2-3.1Zm-.7 4.7c-1.1.8-.9 2.2.3 2.8l6.4 3.2c.6.3 1.3.2 1.8-.2l6.4-4.6-1.2-1.6-6.2 4.4-6.5-3.2c-.4-.2-.7-.5-1-.8Zm0 5c-1.1.8-.9 2.2.3 2.8l6.4 3.2c.6.3 1.3.2 1.8-.2l6.4-4.6-1.2-1.6-6.2 4.4-6.5-3.2c-.4-.2-.7-.5-1-.8Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.2 4.4 11 1.2c.6-.3 1.3-.3 1.9 0l6 2.7c.8.4.9 1.4.2 1.9l-6.2 4.4c-.6.4-1.3.5-2 .1L5 7.5c-1.4-.7-1.3-2.3.2-3.1Zm-.7 4.7c-1.1.8-.9 2.2.3 2.8l6.4 3.2c.6.3 1.3.2 1.8-.2l6.4-4.6-1.2-1.6-6.2 4.4-6.5-3.2c-.4-.2-.7-.5-1-.8Zm0 5c-1.1.8-.9 2.2.3 2.8l6.4 3.2c.6.3 1.3.2 1.8-.2l6.4-4.6-1.2-1.6-6.2 4.4-6.5-3.2c-.4-.2-.7-.5-1-.8Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.story-card [data-a="tbr"].on::before,
[data-ltma-story-flagged].on::before {
  opacity: 1;
}

.story-card .ltma-dismiss-button:hover,
.story-card .ltma-dismiss-button:focus-visible {
  color: #b42318;
  background: color-mix(in srgb, #b42318 10%, transparent);
}

.story-card:has(.ltma-dismiss-button):has([data-a="fav"]) .story-title {
  padding-right: 148px;
}

.story-interaction {
  color: #b42318 !important;
  font-weight: 650;
}
