/* B98: campaign reader on a phone held horizontally. Keep the desktop
   composition and the portrait-orientation notice on their existing owners.
   The narrative and its optional full context remain in the reader's single
   scroll region; neither quotations nor tactical notes are clipped. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1050px) and (pointer: coarse) and (hover: none) {
  html[data-sejm-interface] body #sk-r45-story-reader.r45-story-reader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding: max(7px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
    font-size: calc(15px * var(--r45-story-scale, 1.25));
    line-height: 1.31;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-header {
    flex: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    min-width: 0;
    padding: 0 0 6px !important;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-header > div:first-child {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 9px;
    min-width: 0;
  }
  #sk-r45-story-reader.r45-story-reader .r46-story-phase {
    grid-column: 1;
    align-self: center;
    margin: 0;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
  }
  #sk-r45-story-reader.r45-story-reader [data-r45-eyebrow] {
    grid-column: 2;
    align-self: center;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.25;
  }
  html[data-sejm-interface] body #sk-r45-story-reader.r45-story-reader h1 {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    font-size: clamp(21px, 3vw, 27px) !important;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }
  #sk-r45-story-reader.r45-story-reader [data-r45-location] {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 11px;
    line-height: 1.2;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-header-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: start;
    justify-content: flex-end;
    gap: 5px;
    max-width: none;
    min-width: 0;
  }
  html[data-sejm-interface] body #sk-r45-story-reader.r45-story-reader .r45-story-header-actions button {
    min-width: 44px;
    min-height: 44px !important;
    padding: 4px 7px;
    font-size: 15px !important;
    line-height: 1.12;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-options {
    flex: none;
    max-height: min(36dvh, 168px);
    min-height: 0;
    padding: 5px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 5px 3px 10px 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(96px, 15vw, 130px);
    gap: clamp(8px, 2vw, 17px);
    align-items: start;
    min-height: 0;
    max-width: none;
    margin: 0;
  }
  #sk-r45-story-reader.r45-story-reader article[data-r45-copy] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    max-width: none;
    align-content: start;
  }
  #sk-r45-story-reader.r45-story-reader article[data-r45-copy] > :not(blockquote) {
    grid-column: 1 / -1;
  }
  #sk-r45-story-reader.r45-story-reader article[data-r45-copy] > blockquote {
    min-width: 0;
    margin: 0;
    padding: 5px 8px;
    font-size: .92em;
  }
  #sk-r45-story-reader.r45-story-reader article[data-r45-copy] > blockquote p {
    line-height: 1.3;
  }
  #sk-r45-story-reader.r45-story-reader article[data-r45-copy] > .r75-story-lead {
    margin: 0;
    padding: 0;
    line-height: 1.35;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-plan {
    margin: 0;
    padding: 5px 8px;
    line-height: 1.32;
  }
  #sk-r45-story-reader.r45-story-reader .r61-story-full {
    margin: 0;
    padding: 0;
  }
  #sk-r45-story-reader.r45-story-reader .r61-story-full summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 2px;
  }
  #sk-r45-story-reader.r45-story-reader [data-r45-people] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 3px;
    position: sticky;
    top: 0;
    align-self: start;
    min-width: 0;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-person img,
  #sk-r45-story-reader.r45-story-reader .r45-story-person:nth-child(2) img,
  #sk-r45-story-reader.r45-story-reader[data-r46-kind="outro"] .r45-story-person img {
    width: 100%;
    height: clamp(56px, 21dvh, 90px);
    max-height: 90px;
    object-fit: contain;
    object-position: center bottom;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-person figcaption {
    padding: 3px 2px;
    font-size: 11px;
    line-height: 1.18;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-footer {
    flex: none;
    position: static;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 0 0 !important;
    box-shadow: none;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-footer > .r46-reader-status {
    flex: 1 1 auto;
    min-width: 0;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-footer p {
    max-width: none;
    font-size: 11px;
    line-height: 1.18;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-footer > div:last-child {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    width: auto;
    gap: 6px;
  }
  html[data-sejm-interface] body #sk-r45-story-reader.r45-story-reader .r45-story-footer button {
    min-height: 44px !important;
    min-width: 44px;
    max-width: min(38vw, 220px);
    padding: 4px 9px;
    font-size: 15px !important;
    line-height: 1.14;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-next {
    flex: none;
    min-width: min(31vw, 170px);
  }
}

/* Very narrow landscape phones read the complete exchanges at full text
   width. Portraits still occupy their own small column, beside the text. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 700px) and (pointer: coarse) and (hover: none) {
  #sk-r45-story-reader.r45-story-reader .r45-story-grid {
    grid-template-columns: minmax(0, 1fr) 86px;
  }
  #sk-r45-story-reader.r45-story-reader article[data-r45-copy] {
    grid-template-columns: minmax(0, 1fr);
  }
  #sk-r45-story-reader.r45-story-reader article[data-r45-copy] > * {
    grid-column: 1;
  }
  #sk-r45-story-reader.r45-story-reader .r45-story-header-actions {
    max-width: 155px;
  }
}
