.tlpfl-app-page {
  margin: 0;
  background: #171918;
}

.tlpfl-app-main {
  min-height: 100vh;
}

.tlpfl-shell {
  min-height: 100vh;
  margin: 0;
  padding: clamp(18px, 4vw, 48px);
  background: #171918;
  color: #f2f1ed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tlpfl-shell * {
  box-sizing: border-box;
}

.tlpfl-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1120px;
  margin: 0 auto 18px;
  color: #8f918b;
  font-size: 0.86rem;
  font-weight: 800;
}

.tlpfl-breadcrumb a,
.tlpfl-viewer-title button {
  color: #d8d4c5;
  text-decoration: none;
}

.tlpfl-breadcrumb span:last-child {
  color: #f2f1ed;
}

.tlpfl-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto 24px;
}

.tlpfl-heading h1 {
  margin: 0;
  color: #d8d6cf;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 800;
  line-height: 1.1;
}

.tlpfl-heading p,
.tlpfl-card h2,
.tlpfl-empty p {
  color: #aaa9a2;
}

.tlpfl-heading p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.tlpfl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: clamp(30px, 4.5vw, 54px) clamp(26px, 5vw, 58px);
  max-width: 1120px;
  margin: 0 auto;
}

.tlpfl-card {
  min-width: 0;
}

.tlpfl-cover {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 0.72;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  background: #252824;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
  color: #f2f1ed;
  cursor: pointer;
}

.tlpfl-cover:hover,
.tlpfl-cover:focus-visible {
  border-color: rgba(244, 240, 223, 0.44);
  outline: none;
}

.tlpfl-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.tlpfl-cover-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, transparent 48%, rgba(244, 240, 223, 0.18) 49%, rgba(244, 240, 223, 0.18) 51%, transparent 52%),
    linear-gradient(135deg, #34352f, #1d1f1c);
  color: #e8e3d5;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 900;
  letter-spacing: 0;
}

.tlpfl-pages {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(20, 22, 20, 0.82);
  color: #e7e2d4;
  font-size: 0.76rem;
  font-weight: 700;
}

.tlpfl-card h2 {
  margin: 10px 0 0;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tlpfl-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 46vh;
  text-align: center;
}

.tlpfl-empty h2 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.8rem);
}

.tlpfl-empty p {
  margin: 0;
}

.tlpfl-viewer {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(ellipse at center, rgba(235, 229, 213, 0.12), rgba(12, 13, 12, 0.32) 46%, rgba(6, 7, 7, 0.9) 82%),
    #0d0e0e;
  color: #f2f1ed;
}

.tlpfl-viewer[hidden] {
  display: none;
}

.tlpfl-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 17, 16, 0.9);
}

.tlpfl-viewer-title {
  min-width: 0;
}

.tlpfl-viewer-title nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tlpfl-viewer-title button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.tlpfl-viewer-title button:hover {
  color: #f4f0df;
}

.tlpfl-viewer-bar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tlpfl-viewer-bar button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #252824;
  color: #f2f1ed;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.tlpfl-frame {
  min-height: 0;
  padding: clamp(8px, 2vw, 18px);
  overflow: auto;
}

.tlpfl-frame > * {
  max-width: 100%;
}

.tlpfl-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  min-height: 50vh;
  margin: 0;
  padding: 24px;
  border: 1px dashed rgba(244, 240, 223, 0.28);
  border-radius: 8px;
  color: #d8d6cf;
  text-align: center;
}

.tlpfl-placeholder p {
  margin: 0;
}

.tlpfl-placeholder button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #252824;
  color: #f2f1ed;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

body.tlpfl-viewer-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .tlpfl-shell {
    padding: 18px;
  }

  .tlpfl-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .tlpfl-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 28px 22px;
  }
}
