:root {
      --font-scale: 1;
      --mobile-text-multiplier: 2;
      /* x2 względem dotychczasowego widoku mobilnego */
      --font-scale-mobile: calc(1.30 * var(--mobile-text-multiplier));
      font-size: calc(16px * var(--font-scale));
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: #202a35;
      background: #f4f6f9;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
    }

    [hidden] {
      display: none !important;
    }

    .view-tabs {
      display: flex;
      gap: 8px;
      border-bottom: 1px solid #d8e0ea;
      margin: 0 0 18px;
      padding-bottom: 8px;
    }

    .view-tab {
      border-radius: 10px;
      font-weight: 700;
      padding: 10px 16px;
    }

    .view-tab[aria-pressed="true"] {
      background: #253e5b;
      border-color: #253e5b;
      color: #fff;
    }

    .ministry-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      margin: 0 0 12px;
    }

    .ministry-summary {
      color: #5e6b7c;
      font-size: calc(13px * var(--font-scale));
    }

    .ministry-check {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      cursor: pointer;
      font-size: calc(13px * var(--font-scale));
      color: #33475d;
    }

    .ministry-check input {
      width: 17px;
      height: 17px;
    }

    .ministry-week {
      margin: 22px 0 10px;
      font-size: calc(14px * var(--font-scale));
      color: #49617b;
      font-weight: 750;
    }

    .ministry-entry {
      background: #fff;
      border: 1px solid #e0e6ed;
      border-radius: 14px;
      padding: 15px 17px;
      margin: 10px 0;
      box-shadow: 0 3px 12px rgba(18, 32, 52, .035);
    }

    .ministry-entry.cancelled {
      background: #f9f9fa;
    }

    .ministry-top {
      display: flex;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }

    .ministry-date {
      font-weight: 750;
      font-size: calc(15px * var(--font-scale));
    }

    .ministry-hour {
      color: #345778;
      font-weight: 700;
      font-size: calc(13px * var(--font-scale));
      background: #eaf1f9;
      padding: 4px 8px;
      border-radius: 8px;
    }

    .ministry-cancelled-tag {
      font-size: calc(12px * var(--font-scale));
      color: #8c5222;
      background: #fff1df;
      padding: 4px 8px;
      border-radius: 7px;
    }

    .ministry-detail {
      display: grid;
      grid-template-columns: 115px minmax(0, 1fr);
      gap: 6px 12px;
      font-size: calc(14px * var(--font-scale));
      line-height: 1.45;
    }

    .ministry-detail-label {
      color: #657386;
      font-size: calc(13px * var(--font-scale));
    }

    .ministry-detail-value {
      overflow-wrap: anywhere;
      white-space: pre-wrap;
    }

    .ministry-note {
      color: #8793a2;
      font-style: italic;
    }

    .my-head {
      display: flex;
      align-items: start;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .my-title {
      margin: 0 0 4px;
      font-size: calc(19px * var(--font-scale));
    }

    .my-subtitle {
      font-size: calc(13px * var(--font-scale));
      color: #647185;
      margin: 0;
    }

    .my-count {
      background: #e9f1fa;
      color: #315575;
      border-radius: 10px;
      padding: 8px 12px;
      font-size: calc(13px * var(--font-scale));
      font-weight: 700;
    }

    .my-date-heading {
      margin: 22px 0 9px;
      font-size: calc(14px * var(--font-scale));
      font-weight: 750;
      color: #48617b;
    }

    .my-entry {
      border: 1px solid #dde6f1;
      background: #fff;
      border-radius: 13px;
      padding: 14px 17px;
      margin: 9px 0;
      box-shadow: 0 3px 12px rgba(18, 32, 52, .035);
    }

    .my-task {
      font-size: calc(15px * var(--font-scale));
      font-weight: 700;
      color: #202a35;
      margin: 6px 0;
    }

    .my-tag {
      font-size: calc(11px * var(--font-scale));
      color: #3d5978;
      font-weight: 700;
      background: #edf4fb;
      border-radius: 6px;
      padding: 4px 7px;
      display: inline-block;
    }

    .my-meta {
      color: #677588;
      font-size: calc(13px * var(--font-scale));
      line-height: 1.5;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .my-assignee {
      font-weight: 650;
      color: #3d5978;
    }

    .my-person {
      overflow-wrap: anywhere;
      font-size: calc(15px * var(--font-scale));
      font-weight: 700;
      margin: 0 0 3px;
    }

    .shell {
      max-width: 950px;
      margin: 0 auto;
      padding: 20px 16px 56px;
    }

    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 22px;
    }

    .brand {
      font-size: calc(22px * var(--font-scale));
      font-weight: 750;
      letter-spacing: -.5px;
    }

    .subtitle {
      color: #647185;
      font-size: calc(13px * var(--font-scale));
      margin-top: 3px;
    }

    button,
    select {
      font: inherit;
    }

    button {
      background: #fff;
      color: #213047;
      border: 1px solid #d8e0ea;
      border-radius: 10px;
      padding: 10px 14px;
      cursor: pointer;
    }

    button:disabled {
      opacity: .55;
      cursor: default;
    }

    select {
      background: #fff;
      border: 1px solid #d8e0ea;
      border-radius: 10px;
      padding: 11px 13px;
      min-width: 220px;
      max-width: 100%;
    }

    .toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: end;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 18px;
    }

    .control {
      display: flex;
      flex-direction: column;
      gap: 7px;
    }

    .week-navigation {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .week-navigation select {
      flex: 1 1 205px;
    }

    .nav-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 43px;
      height: 43px;
      padding: 0;
      flex: 0 0 43px;
    }

    .nav-icon svg {
      width: 20px;
      height: 20px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .today-button {
      height: 43px;
      white-space: nowrap;
      font-size: calc(13px * var(--font-scale));
      font-weight: 650;
    }

    .nav-icon:focus-visible,
    .today-button:focus-visible,
    select:focus-visible {
      outline: 3px solid #6a9bed;
      outline-offset: 2px;
    }

    .week-position {
      color: #718094;
      font-size: calc(12px * var(--font-scale));
      min-height: 16px;
    }

    .control label {
      color: #57677a;
      font-size: calc(12px * var(--font-scale));
      font-weight: 650;
    }

    .status {
      color: #647185;
      font-size: calc(12px * var(--font-scale));
      min-height: 18px;
    }

    .card {
      background: white;
      border: 1px solid #e0e6ed;
      border-radius: 16px;
      box-shadow: 0 5px 16px rgba(18, 32, 52, .045);
      overflow: hidden;
      margin: 16px 0;
    }

    .card-head {
      padding: 18px 20px;
      background: #edf2f8;
      border-bottom: 1px solid #e0e6ed;
    }

    .card-head h2 {
      margin: 0;
      font-size: calc(18px * var(--font-scale));
    }

    .card-head p {
      color: #667587;
      margin: 5px 0 0;
      font-size: calc(13px * var(--font-scale));
    }

    .group-head {
      margin: 0;
      padding: 14px 20px 8px;
      font-size: calc(13px * var(--font-scale));
      font-weight: 750;
      color: #5f728b;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .item {
      display: flex;
      align-items: start;
      padding: 13px 20px;
      gap: 12px;
      border-bottom: 1px solid #eef1f5;
    }

    .item:last-child {
      border-bottom: none;
    }

    .num {
      flex: 0 0 34px;
      font-size: calc(13px * var(--font-scale));
      font-weight: 700;
      color: #566780;
      padding-top: 1px;
    }

    .item-main {
      min-width: 0;
      flex: 1;
      display: flex;
      flex-wrap: wrap;
      align-items: start;
      justify-content: space-between;
      gap: 4px 16px;
    }

    .task {
      min-width: 160px;
      flex: 1;
      font-weight: 600;
      font-size: calc(14px * var(--font-scale));
    }

    .person {
      font-size: calc(14px * var(--font-scale));
      text-align: right;
      overflow-wrap: anywhere;
    }

    .empty {
      color: #8793a2;
      font-style: italic;
    }

    .helper {
      color: #677588;
      margin-top: 6px;
      font-size: calc(13px * var(--font-scale));
    }

    .additional {
      color: #68798d;
      font-size: calc(12px * var(--font-scale));
      margin-top: 4px;
    }

    .notes {
      padding: 4px 0;
    }

    .notice {
      background: #fff;
      border-radius: 12px;
      border: 1px solid #e0e6ed;
      padding: 14px 16px;
      margin-top: 16px;
    }

    .error {
      color: #9a2e2e;
      background: #fff0f0;
      border-color: #f2c8c8;
    }

    footer {
      color: #778496;
      font-size: calc(12px * var(--font-scale));
      text-align: center;
      margin-top: 24px;
    }

    @media (max-width: 620px) {
      .brand {
        font-size: calc(19px * var(--font-scale));
      }

      .shell {
        padding: 14px 10px 30px;
      }

      .card-head {
        padding: 16px;
      }

      .item {
        padding: 12px 14px;
      }

      .item-main {
        display: block;
      }

      .task {
        min-width: 0;
        margin-bottom: 4px;
      }

      .person {
        text-align: left;
      }

      select {
        width: 100%;
      }

      .toolbar .control {
        flex: 1 1 180px;
        width: 100%;
      }

      .week-navigation {
        gap: 6px;
      }

      .week-navigation select {
        min-width: 0;
        flex-basis: 110px;
      }

      .today-button {
        width: 100%;
      }

      .view-tabs {
        flex-wrap: wrap;
      }

      .ministry-detail {
        grid-template-columns: 1fr;
        gap: 2px;
      }

      .ministry-detail-label:not(:first-child) {
        margin-top: 8px;
      }
    }

    .auth-shell {
      max-width: 480px;
      margin: 11vh auto;
      background: white;
      padding: 26px;
      border: 1px solid #d9e2ec;
      border-radius: 18px;
      box-shadow: 0 12px 35px #10283c14;
    }

    .auth-shell h1 {
      margin: 0 0 8px;
      font-size: calc(24px * var(--font-scale));
    }

    .auth-shell p {
      color: #536579;
      line-height: 1.55;
    }

    .auth-subtitle {
      margin: 0 0 20px;
      color: #647185;
      font-size: calc(15px * var(--font-scale));
      font-weight: 600;
    }

    .auth-login {
      display: inline-block;
      padding: 12px 18px;
      border-radius: 10px;
      background: #253e5b;
      color: white;
      text-decoration: none;
      font-weight: 700;
    }

    .auth-error {
      color: #962d2d !important;
    }

    /* Powiększ czcionki przy wąskim viewport.
       Dodatkowa klasa jw-phone obsługuje iframe raportujące większy viewport. */
    @media (max-width: 620px) {
      :root {
        --font-scale: var(--font-scale-mobile);
      }
    }

    /* Duże przyciski na telefonie: zakładki oraz nawigacja tygodniowa.
       Ta sekcja nadpisuje wcześniejsze, mniejsze wymiary. */
    @media (max-width: 620px) {
      .view-tabs {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
      }

      .view-tab {
        width: 100%;
        min-height: 72px;
        padding: 16px 20px;
        font-size: calc(24px * var(--mobile-text-multiplier));
        line-height: 1.2;
        border-radius: 14px;
      }

      .week-navigation {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr) 76px;
        gap: 8px;
        align-items: stretch;
        width: 100%;
      }

      .week-navigation .nav-icon {
        width: 76px;
        height: 76px;
        min-width: 0;
        flex: none;
        border-radius: 14px;
      }

      .week-navigation .nav-icon svg {
        width: 36px;
        height: 36px;
      }

      .week-navigation select {
        width: 100%;
        min-width: 0;
        height: 76px;
        padding: 10px 8px;
        font-size: calc(19px * var(--mobile-text-multiplier));
        flex: none;
      }

      .week-navigation .today-button {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 68px;
        height: auto;
        padding: 14px 20px;
        white-space: normal;
        font-size: calc(23px * var(--mobile-text-multiplier));
      }

      .control label {
        font-size: calc(18px * var(--mobile-text-multiplier));
      }
    }

    /* Bardzo wąskie telefony: zachowujemy czytelną datę i duże strzałki. */
    @media (max-width: 360px) {
      .week-navigation {
        grid-template-columns: 68px minmax(0, 1fr) 68px;
        gap: 6px;
      }

      .week-navigation .nav-icon {
        width: 68px;
        height: 72px;
      }

      .week-navigation select {
        height: 72px;
        font-size: calc(17px * var(--mobile-text-multiplier));
      }
    }

    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    #logout {
      border-color: #cbd5e1;
      color: #526477;
    }

    .auth-wait {
      margin: 12px auto;
      color: #5a6b7e;
      text-align: center;
    }

    /* Wysokie przyciski i układ nawigacji dla dwukrotnie większego tekstu. */
    @media (max-width: 620px) {
      .view-tab {
        height: auto;
        min-height: 96px;
        overflow-wrap: anywhere;
        white-space: normal;
      }

      .week-navigation {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      }

      .week-navigation select {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        height: auto;
        min-height: 82px;
        text-overflow: ellipsis;
      }

      .week-navigation #prev-week,
      .week-navigation #next-week {
        width: 100%;
        height: 82px;
      }

      .week-navigation #prev-week {
        grid-column: 1;
        grid-row: 2;
      }

      .week-navigation #next-week {
        grid-column: 2;
        grid-row: 2;
      }

      .week-navigation .today-button {
        grid-column: 1 / -1;
        grid-row: 3;
        height: auto;
        min-height: 85px;
      }

      .ministry-detail {
        grid-template-columns: minmax(0, 1fr);
      }

      .item-main,
      .item {
        min-width: 0;
      }

      button,
      select {
        overflow-wrap: anywhere;
      }

      .shell {
        overflow-wrap: anywhere;
      }
    }

    @media (max-width: 360px) {
      .week-navigation {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      }

      .week-navigation #prev-week,
      .week-navigation #next-week {
        height: 82px;
      }

      .week-navigation select {
        height: auto;
        min-height: 82px;
      }
    }

    /* Kalendarz zboru — czytelne karty wydarzeń. */
    .calendar-month {
      color: #48617b;
      margin: 24px 0 10px;
      font-size: calc(15px * var(--font-scale));
      font-weight: 750;
      text-transform: capitalize;
    }

    .calendar-entry {
      background: white;
      border: 1px solid #e0e6ed;
      border-radius: 14px;
      padding: 16px 18px;
      margin: 10px 0;
      box-shadow: 0 3px 12px rgba(18, 32, 52, .035);
    }

    .calendar-name {
      font-size: calc(16px * var(--font-scale));
      font-weight: 750;
      overflow-wrap: anywhere;
    }

    .calendar-meta {
      color: #536579;
      font-size: calc(13px * var(--font-scale));
      margin-top: 8px;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .calendar-status {
      font-size: calc(12px * var(--font-scale));
      color: #49617b;
    }

    .calendar-ongoing {
      display: inline-block;
      margin-top: 8px;
      font-size: calc(12px * var(--font-scale));
      background: #eaf1f9;
      padding: 4px 9px;
      border-radius: 7px;
    }

    /* Na telefonie strzałka, data, strzałka, aktualny tydzień — zawsze JEDEN rząd. */
    @media (max-width: 620px) {
      .week-navigation {
        display: grid;
        grid-template-columns: clamp(38px, 11vw, 48px) minmax(0, 1fr) clamp(38px, 11vw, 48px) clamp(82px, 26vw, 112px);
        gap: 4px;
        align-items: stretch;
        width: 100%;
      }

      .week-navigation #prev-week,
      .week-navigation #next-week {
        grid-row: 1;
        width: 100%;
        height: 60px;
        min-height: 60px;
        padding: 0;
      }

      .week-navigation #prev-week {
        grid-column: 1;
      }

      .week-navigation select {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        width: 100%;
        height: 60px;
        min-height: 60px;
        padding: 3px 1px;
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .week-navigation #next-week {
        grid-column: 3;
      }

      .week-navigation .nav-icon {
        width: 100%;
        height: 60px;
        min-height: 60px;
      }

      .week-navigation .nav-icon svg {
        width: 25px;
        height: 25px;
      }

      .week-navigation .today-button {
        grid-column: 4;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        height: 60px;
        min-height: 60px;
        padding: 3px 3px;
        white-space: normal;
        overflow-wrap: normal;
        font-size: 13px;
        line-height: 1.12;
      }

      .view-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
      }

      .view-tab {
        min-height: 48px;
        height: auto;
        padding: 8px 5px;
        font-size: 15px;
        line-height: 1.2;
      }
    }


    /* JW Oliwa: nawigacja tygodnia w jednym rzędzie na telefonie. */
    @media (max-width: 620px) {
      #program-view .week-navigation {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 42px 92px !important;
        grid-template-rows: 56px !important;
        gap: 4px !important;
        width: 100% !important;
        align-items: stretch !important;
      }

      #program-view .week-navigation>* {
        grid-row: 1 !important;
        min-width: 0 !important;
        width: 100% !important;
        height: 56px !important;
        min-height: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
      }

      #program-view #prev-week {
        grid-column: 1 !important;
      }

      #program-view #week {
        grid-column: 2 !important;
        padding: 2px 0 !important;
        font-size: 13px !important;
        text-overflow: ellipsis;
      }

      #program-view #next-week {
        grid-column: 3 !important;
      }

      #program-view #current-week {
        grid-column: 4 !important;
        padding: 3px 2px !important;
        font-size: 12px !important;
        line-height: 1.15 !important;
        white-space: normal !important;
        overflow-wrap: normal !important;
      }

      #program-view .week-navigation .nav-icon svg {
        width: 24px !important;
        height: 24px !important;
      }
    }

    @media (max-width: 360px) {
      #program-view .week-navigation {
        grid-template-columns: 36px minmax(0, 1fr) 36px 82px !important;
        gap: 3px !important;
      }

      #program-view #week {
        font-size: 12px !important;
      }

      #program-view #current-week {
        font-size: 11px !important;
      }
    }


    /* Duże sterowanie dotykowe: cztery elementy w jednym rzędzie. */
    @media (max-width: 620px) {
      #program-view .week-navigation {
        grid-template-columns: minmax(62px, 0.85fr) minmax(0, 1.8fr) minmax(62px, 0.85fr) minmax(0, 1.45fr) !important;
        grid-template-rows: 108px !important;
        gap: 5px !important;
      }

      #program-view .week-navigation>* {
        height: 108px !important;
        min-height: 108px !important;
        border-radius: 14px !important;
      }

      #program-view .week-navigation .nav-icon svg {
        width: 58px !important;
        height: 58px !important;
        max-width: 95%;
      }

      #program-view #week {
        /* Większa data; na wąskim ekranie stosujemy skrócony rok (np. 23.11.26). */
        font-size: clamp(26px, 7vw, 30px) !important;
        font-weight: 700 !important;
        letter-spacing: -0.45px !important;
        padding: 4px 1px !important;
      }

      #program-view #current-week {
        font-size: clamp(16px, 4.5vw, 24px) !important;
        font-weight: 750 !important;
        line-height: 1.12 !important;
        padding: 5px 2px !important;
        overflow-wrap: anywhere !important;
      }
    }

    @media (max-width: 360px) {
      #program-view .week-navigation {
        grid-template-columns: minmax(52px, .8fr) minmax(0, 1.7fr) minmax(52px, .8fr) minmax(0, 1.4fr) !important;
        gap: 3px !important;
      }

      #program-view .week-navigation .nav-icon svg {
        width: 48px !important;
        height: 48px !important;
      }
    }

    /* Telefon wewnątrz iframe Apps Script może raportować viewport > 620 px.
       Powtarzamy WYŁĄCZNIE telefoniczne style dla klasy jw-phone,
       bez powiększania elementów tabletowych. */
    html.jw-phone .brand {
      font-size: calc(19px * var(--font-scale));
    }

    html.jw-phone .shell {
      padding: 14px 10px 30px;
    }

    html.jw-phone .card-head {
      padding: 16px;
    }

    html.jw-phone .item {
      padding: 12px 14px;
    }

    html.jw-phone .item-main {
      display: block;
    }

    html.jw-phone .task {
      min-width: 0;
      margin-bottom: 4px;
    }

    html.jw-phone .person {
      text-align: left;
    }

    html.jw-phone select {
      width: 100%;
    }

    html.jw-phone .toolbar .control {
      flex: 1 1 180px;
      width: 100%;
    }

    html.jw-phone .week-navigation {
      gap: 6px;
    }

    html.jw-phone .week-navigation select {
      min-width: 0;
      flex-basis: 110px;
    }

    html.jw-phone .today-button {
      width: 100%;
    }

    html.jw-phone .view-tabs {
      flex-wrap: wrap;
    }

    html.jw-phone .ministry-detail {
      grid-template-columns: 1fr;
      gap: 2px;
    }

    html.jw-phone .ministry-detail-label:not(:first-child) {
      margin-top: 8px;
    }

    html.jw-phone {
      --font-scale: var(--font-scale-mobile);
    }

    html.jw-phone .view-tabs {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 12px;
    }

    html.jw-phone .view-tab {
      width: 100%;
      min-height: 72px;
      padding: 16px 20px;
      font-size: calc(24px * var(--mobile-text-multiplier));
      line-height: 1.2;
      border-radius: 14px;
    }

    html.jw-phone .week-navigation {
      display: grid;
      grid-template-columns: 76px minmax(0, 1fr) 76px;
      gap: 8px;
      align-items: stretch;
      width: 100%;
    }

    html.jw-phone .week-navigation .nav-icon {
      width: 76px;
      height: 76px;
      min-width: 0;
      flex: none;
      border-radius: 14px;
    }

    html.jw-phone .week-navigation .nav-icon svg {
      width: 36px;
      height: 36px;
    }

    html.jw-phone .week-navigation select {
      width: 100%;
      min-width: 0;
      height: 76px;
      padding: 10px 8px;
      font-size: calc(19px * var(--mobile-text-multiplier));
      flex: none;
    }

    html.jw-phone .week-navigation .today-button {
      grid-column: 1 / -1;
      width: 100%;
      min-height: 68px;
      height: auto;
      padding: 14px 20px;
      white-space: normal;
      font-size: calc(23px * var(--mobile-text-multiplier));
    }

    html.jw-phone .control label {
      font-size: calc(18px * var(--mobile-text-multiplier));
    }

    html.jw-phone .view-tab {
      height: auto;
      min-height: 96px;
      overflow-wrap: anywhere;
      white-space: normal;
    }

    html.jw-phone .week-navigation {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    html.jw-phone .week-navigation select {
      grid-column: 1 / -1;
      grid-row: 1;
      width: 100%;
      height: auto;
      min-height: 82px;
      text-overflow: ellipsis;
    }

    html.jw-phone .week-navigation #prev-week,
    html.jw-phone .week-navigation #next-week {
      width: 100%;
      height: 82px;
    }

    html.jw-phone .week-navigation #prev-week {
      grid-column: 1;
      grid-row: 2;
    }

    html.jw-phone .week-navigation #next-week {
      grid-column: 2;
      grid-row: 2;
    }

    html.jw-phone .week-navigation .today-button {
      grid-column: 1 / -1;
      grid-row: 3;
      height: auto;
      min-height: 85px;
    }

    html.jw-phone .ministry-detail {
      grid-template-columns: minmax(0, 1fr);
    }

    html.jw-phone .item-main,
    html.jw-phone .item {
      min-width: 0;
    }

    html.jw-phone button,
    html.jw-phone select {
      overflow-wrap: anywhere;
    }

    html.jw-phone .shell {
      overflow-wrap: anywhere;
    }

    html.jw-phone .week-navigation {
      display: grid;
      grid-template-columns: clamp(38px, 11vw, 48px) minmax(0, 1fr) clamp(38px, 11vw, 48px) clamp(82px, 26vw, 112px);
      gap: 4px;
      align-items: stretch;
      width: 100%;
    }

    html.jw-phone .week-navigation #prev-week,
    html.jw-phone .week-navigation #next-week {
      grid-row: 1;
      width: 100%;
      height: 60px;
      min-height: 60px;
      padding: 0;
    }

    html.jw-phone .week-navigation #prev-week {
      grid-column: 1;
    }

    html.jw-phone .week-navigation select {
      grid-column: 2;
      grid-row: 1;
      min-width: 0;
      width: 100%;
      height: 60px;
      min-height: 60px;
      padding: 3px 1px;
      font-size: 15px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    html.jw-phone .week-navigation #next-week {
      grid-column: 3;
    }

    html.jw-phone .week-navigation .nav-icon {
      width: 100%;
      height: 60px;
      min-height: 60px;
    }

    html.jw-phone .week-navigation .nav-icon svg {
      width: 25px;
      height: 25px;
    }

    html.jw-phone .week-navigation .today-button {
      grid-column: 4;
      grid-row: 1;
      width: 100%;
      min-width: 0;
      height: 60px;
      min-height: 60px;
      padding: 3px 3px;
      white-space: normal;
      overflow-wrap: normal;
      font-size: 13px;
      line-height: 1.12;
    }

    html.jw-phone .view-tabs {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }

    html.jw-phone .view-tab {
      min-height: 48px;
      height: auto;
      padding: 8px 5px;
      font-size: 15px;
      line-height: 1.2;
    }

    html.jw-phone #program-view .week-navigation {
      display: grid !important;
      grid-template-columns: 42px minmax(0, 1fr) 42px 92px !important;
      grid-template-rows: 56px !important;
      gap: 4px !important;
      width: 100% !important;
      align-items: stretch !important;
    }

    html.jw-phone #program-view .week-navigation>* {
      grid-row: 1 !important;
      min-width: 0 !important;
      width: 100% !important;
      height: 56px !important;
      min-height: 0 !important;
      margin: 0 !important;
      box-sizing: border-box !important;
    }

    html.jw-phone #program-view #prev-week {
      grid-column: 1 !important;
    }

    html.jw-phone #program-view #week {
      grid-column: 2 !important;
      padding: 2px 0 !important;
      font-size: 13px !important;
      text-overflow: ellipsis;
    }

    html.jw-phone #program-view #next-week {
      grid-column: 3 !important;
    }

    html.jw-phone #program-view #current-week {
      grid-column: 4 !important;
      padding: 3px 2px !important;
      font-size: 12px !important;
      line-height: 1.15 !important;
      white-space: normal !important;
      overflow-wrap: normal !important;
    }

    html.jw-phone #program-view .week-navigation .nav-icon svg {
      width: 24px !important;
      height: 24px !important;
    }

    html.jw-phone #program-view .week-navigation {
      grid-template-columns: minmax(62px, 0.85fr) minmax(0, 1.8fr) minmax(62px, 0.85fr) minmax(0, 1.45fr) !important;
      grid-template-rows: 108px !important;
      gap: 5px !important;
    }

    html.jw-phone #program-view .week-navigation>* {
      height: 108px !important;
      min-height: 108px !important;
      border-radius: 14px !important;
    }

    html.jw-phone #program-view .week-navigation .nav-icon svg {
      width: 58px !important;
      height: 58px !important;
      max-width: 95%;
    }

    html.jw-phone #program-view #week {

      font-size: clamp(26px, 7vw, 30px) !important;
      font-weight: 700 !important;
      letter-spacing: -0.45px !important;
      padding: 4px 1px !important;
    }

    html.jw-phone #program-view #current-week {
      font-size: clamp(16px, 4.5vw, 24px) !important;
      font-weight: 750 !important;
      line-height: 1.12 !important;
      padding: 5px 2px !important;
      overflow-wrap: anywhere !important;
    }

    /* Telefon: duże, ale mieszczące się w dwóch rzędach zakładki.
       Wartości działają także wtedy, gdy iframe raportuje ponad 620px. */
    html.jw-phone .view-tabs {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    html.jw-phone .view-tab {
      min-height: 68px;
      padding: 12px 8px;
      font-size: 21px;
      line-height: 1.15;
      overflow-wrap: normal;
    }

    html.jw-phone {
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
    }

    /* Tablet: osobna skala. Na telefonach zachowujemy obecny wygląd. */
    html.jw-tablet {
      --font-scale: 1.12 !important;
      --mobile-text-multiplier: 1 !important;
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
    }

    html.jw-tablet .view-tabs {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
      gap: 8px;
    }

    html.jw-tablet .view-tab {
      width: 100%;
      min-height: 56px;
      height: auto;
      padding: 11px 10px;
      font-size: 17px;
      line-height: 1.25;
      border-radius: 10px;
    }

    html.jw-tablet .control label {
      font-size: 16px;
    }

    html.jw-tablet .ministry-detail {
      grid-template-columns: 120px minmax(0, 1fr);
      gap: 6px 12px;
    }

    html.jw-tablet #program-view .week-navigation {
      display: grid !important;
      grid-template-columns: 58px minmax(0, 1.8fr) 58px minmax(140px, 1fr) !important;
      grid-template-rows: 64px !important;
      gap: 8px !important;
      width: 100% !important;
    }

    html.jw-tablet #program-view .week-navigation>* {
      grid-row: 1 !important;
      height: 64px !important;
      min-height: 64px !important;
      min-width: 0 !important;
      border-radius: 10px !important;
    }

    html.jw-tablet #program-view .week-navigation .nav-icon svg {
      width: 30px !important;
      height: 30px !important;
    }

    html.jw-tablet #program-view #week {
      font-size: 21px !important;
      font-weight: 700 !important;
      letter-spacing: 0 !important;
      padding: 5px 8px !important;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    html.jw-tablet #program-view #current-week {
      font-size: 17px !important;
      font-weight: 700 !important;
      padding: 6px 10px !important;
      line-height: 1.2 !important;
    }

    /* iPad w podzielonym widoku: przyciski pozostają w jednym rzędzie. */
    @media (max-width: 650px) {
      html.jw-tablet #program-view .week-navigation {
        grid-template-columns: 44px minmax(0, 1fr) 44px minmax(100px, .8fr) !important;
        grid-template-rows: 56px !important;
        gap: 4px !important;
      }

      html.jw-tablet #program-view .week-navigation>* {
        height: 56px !important;
        min-height: 56px !important;
      }

      html.jw-tablet #program-view #week {
        font-size: 16px !important;
      }

      html.jw-tablet #program-view #current-week {
        font-size: 14px !important;
      }

      html.jw-tablet #program-view .week-navigation .nav-icon svg {
        width: 25px !important;
        height: 25px !important;
      }

      html.jw-tablet .view-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    /* Panel nawigacyjny zawsze widoczny */
    .view-tabs {
      position: sticky;
      top: 0;
      z-index: 1000;

      background: #f4f6f9;
      padding: 10px 0;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    }

    /* Czytelniejsze linie między punktami programu zebrań. */
    #program-view .card .item {
      border-bottom: 2px solid #b1bdcb;
    }

    #program-view .card .item:last-child {
      border-bottom: none;
    }

    /* Dwa poziomy przyklejonej nawigacji:
       1) zakładki na górze, 2) wybór tygodnia bezpośrednio pod nimi. */
    .view-tabs {
      position: sticky;
      top: 0;
      z-index: 1000;
      background: #f4f6f9;
    }

    #program-view .toolbar {
      position: sticky;
      top: var(--jw-tabs-sticky-height, 0px);
      z-index: 999;
      background: #f4f6f9;
      padding: 8px 0 10px;
      border-bottom: 1px solid #b1bdcb;
      box-shadow: 0 5px 9px rgba(21, 36, 54, 0.07);
    }

    /* #pwa-session-details {
      display: none !important;
    } */

    /* Piąta zakładka — zachowuje duże przyciski na telefonie. */
    html.jw-phone #tab-finance {
      grid-column: 1 / -1;
    }

    html.jw-tablet .view-tabs {
      grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }

    #finance-view {
      min-width: 0;
    }

    #finance-content {
      margin: 12px 0 28px;
    }

    .finance-preview {
      display: block;
      width: 100%;
      max-width: 100%;
      padding: 0;
      margin: 0 auto;
      background: #fff;
      border: 1px solid #b1bdcb;
      border-radius: 12px;
      overflow: hidden;
      cursor: zoom-in;
    }

    .finance-preview img {
      display: block;
      width: 100%;
      height: auto;
      object-fit: contain;
    }

    .finance-lightbox {
      position: fixed;
      inset: 0;
      z-index: 5000;
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;
      height: 100dvh;
      background: rgba(13, 23, 36, .98);
      color: #fff;
    }

    .finance-lightbox-toolbar {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      flex: 0 0 auto;
      padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    }

    .finance-lightbox-toolbar button {
      min-height: 46px;
      min-width: 46px;
      background: #293c52;
      border: 1px solid #69809a;
      color: #fff;
      font-weight: 750;
      font-size: 20px;
    }

    #finance-lightbox-close {
      font-size: 15px;
      margin-left: auto;
    }

    #finance-zoom-label {
      min-width: 58px;
      font-size: 15px;
      text-align: center;
    }

    .finance-lightbox-stage {
      overflow: auto;
      flex: 1 1 auto;
      min-height: 0;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
    }

    .finance-lightbox-stage img {
      display: block;
      max-width: none;
      max-height: none;
      margin: auto;
      user-select: none;
      -webkit-user-select: none;
      cursor: zoom-in;
    }

    @media (max-width: 620px) {
      #finance-content {
        margin-top: 8px;
      }

      .finance-lightbox-toolbar {
        gap: 5px;
        padding-left: 8px;
        padding-right: 8px;
      }

      .finance-lightbox-toolbar button {
        padding: 8px;
      }
    }

    /* === ROZBUDOWA: zakładki, pełna data na telefonie, nowe strony === */
    .shell {
      max-width: 1360px;
    }

    .view-tabs {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 9px;
    }

    .view-tab {
      min-width: 0;
      min-height: 62px;
      padding: 11px 9px;
      line-height: 1.2;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    html.jw-tablet .view-tabs,
    html.jw-phone .view-tabs {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    html.jw-tablet .view-tab {
      min-height: 72px;
      padding: 10px 7px;
      font-size: 17px;
    }

    html.jw-phone .view-tab {
      width: 100%;
      min-height: 96px;
      padding: 10px 5px;
      font-size: 19px;
      font-weight: 750;
      line-height: 1.16;
      border-radius: 12px;
      overflow-wrap: anywhere;
    }

    /* Poprzednia wersja rozciągała Finanse na cały wiersz. */
    html.jw-phone #tab-finance {
      grid-column: auto;
    }

    /* Zostawiamy cztery elementy nawigacji w jednym rzędzie.
       Więcej szerokości dla daty dzięki węższym strzałkom. */
    html.jw-phone #program-view .week-navigation {
      display: grid !important;
      grid-template-columns: 44px minmax(0, 1fr) 44px 90px !important;
      grid-template-rows: 90px !important;
      gap: 4px !important;
      width: 100% !important;
    }

    html.jw-phone #program-view .week-navigation>* {
      height: 90px !important;
      min-height: 90px !important;
      min-width: 0 !important;
      width: 100% !important;
      grid-row: 1 !important;
      padding: 3px 1px !important;
    }

    html.jw-phone #program-view #prev-week {
      grid-column: 1 !important;
    }

    html.jw-phone #program-view #week {
      grid-column: 2 !important;
      font-size: 24px !important;
      font-weight: 750 !important;
      letter-spacing: -0.65px !important;
      padding: 3px 1px !important;
      white-space: nowrap !important;
    }

    html.jw-phone #program-view #next-week {
      grid-column: 3 !important;
    }

    html.jw-phone #program-view #current-week {
      grid-column: 4 !important;
      font-size: 15px !important;
      font-weight: 750 !important;
      white-space: normal !important;
      overflow-wrap: normal !important;
      word-break: normal !important;
      line-height: 1.13 !important;
    }

    html.jw-phone #program-view .week-navigation .nav-icon svg {
      width: 39px !important;
      height: 39px !important;
    }

    html.jw-phone-compact #program-view .week-navigation {
      grid-template-columns: 38px minmax(0, 1fr) 38px 80px !important;
      gap: 3px !important;
    }

    html.jw-phone-compact #program-view #week {
      font-size: 20px !important;
    }

    html.jw-phone-compact #program-view #current-week {
      font-size: 14px !important;
    }

    html.jw-phone-compact .view-tab {
      font-size: 17px;
      min-height: 96px;
    }

    /* Grupy służby, pionierzy i obowiązki */
    .extra-status {
      color: #536579;
      min-height: 20px;
      margin: 10px 0;
      font-size: 15px;
    }

    .extra-page-title {
      font-size: 23px;
      margin: 12px 0 18px;
      color: #253e5b;
    }

    .extra-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
      gap: 14px;
    }

    .extra-card {
      border: 1px solid #b5c2d0;
      border-radius: 14px;
      background: #fff;
      padding: 17px;
      min-width: 0;
      overflow-wrap: anywhere;
      font-size: 16px;
    }

    .extra-card h2 {
      margin: 0 0 12px;
      font-size: 21px;
      color: #243c56;
    }

    .extra-card h3 {
      margin: 0 0 10px;
      font-size: 18px;
      color: #243c56;
    }

    .extra-role {
      padding: 8px 0;
      border-bottom: 1px solid #bdc8d5;
      line-height: 1.45;
    }

    .extra-role strong {
      display: block;
      font-size: 13px;
      color: #566b80;
    }

    .extra-members {
      margin: 12px 0 0;
      padding-left: 25px;
      line-height: 1.55;
    }

    .extra-members li {
      padding: 5px 0;
      border-bottom: 1px solid #d0d8e2;
    }

    .extra-members li:last-child {
      border-bottom: 0;
    }

    .extra-summary {
      font-weight: 700;
      margin: 8px 0 16px;
      color: #385572;
      font-size: 18px;
    }

    .extra-table-scroll {
      width: 100%;
      overflow-x: auto;
      overscroll-behavior-inline: contain;
    }

    .extra-table {
      width: 100%;
      border-collapse: collapse;
      background: #fff;
      text-align: left;
    }

    .extra-table th,
    .extra-table td {
      border-bottom: 1px solid #aebccc;
      padding: 13px 12px;
      vertical-align: top;
      overflow-wrap: anywhere;
    }

    .extra-table th {
      background: #e7edf5;
      color: #2b4157;
      position: sticky;
      top: 0;
      z-index: 1;
    }

    .extra-table tbody tr:nth-child(even) {
      background: #f7f9fc;
    }

    .extra-table .unset {
      color: #758495;
      font-style: italic;
    }

    .extra-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin: 12px 0;
    }

    .extra-controls input,
    .extra-controls select {
      font: inherit;
      border: 1px solid #aebdcd;
      border-radius: 10px;
      padding: 12px;
      min-width: 0;
      background: white;
      color: #202a35;
    }

    .extra-controls input {
      flex: 1 1 235px;
    }

    .extra-controls select {
      flex: 0 1 180px;
    }

    .territory-table {
      min-width: 930px;
      font-size: 14px;
    }

    .territory-table td {
      padding: 10px 12px;
    }

    .territory-summary {
      font-weight: 700;
      font-size: 15px;
      margin: 8px 0;
    }

    .territory-meta {
      color: #667587;
      font-size: 13px;
      margin: 5px 0 12px;
    }

    .territory-more {
      display: block;
      margin: 18px auto;
      min-height: 48px;
      font-weight: 750;
    }

    .territory-card-list {
      display: none;
    }

    .territory-entry {
      border: 1px solid #b2c1d0;
      background: white;
      border-radius: 12px;
      padding: 12px 14px;
      margin: 10px 0;
    }

    .territory-entry h3 {
      font-size: 19px;
      margin: 0 0 9px;
    }

    .territory-entry dl {
      margin: 0;
      display: grid;
      grid-template-columns: 110px minmax(0, 1fr);
      gap: 7px 10px;
    }

    .territory-entry dt {
      color: #5b6c80;
    }

    .territory-entry dd {
      margin: 0;
      overflow-wrap: anywhere;
    }

    @media (max-width: 620px) {
      .territory-table-scroll {
        display: none;
      }

      .territory-card-list {
        display: block;
      }

      html.jw-phone .extra-card h2 {
        font-size: 23px;
      }
    }

    html.jw-phone .territory-table-scroll {
      display: none;
    }

    html.jw-phone .territory-card-list {
      display: block;
    }

    html.jw-phone .extra-grid {
      grid-template-columns: minmax(0, 1fr);
    }

    html.jw-phone .extra-card {
      font-size: 19px;
    }

    html.jw-phone .extra-role strong {
      font-size: 16px;
    }

    html.jw-phone .extra-summary {
      font-size: 20px;
    }

    html.jw-phone .territory-summary {
      font-size: 18px;
    }

    html.jw-phone .extra-controls input,
    html.jw-phone .extra-controls select {
      font-size: 18px;
      min-height: 55px;
    }

    html.jw-phone .extra-table {
      font-size: 17px;
    }

    html.jw-phone .extra-table th,
    html.jw-phone .extra-table td {
      padding: 14px 8px;
    }

    html.jw-phone .extra-members {
      font-size: 18px;
    }

    html.jw-phone .territory-entry {
      font-size: 16px;
    }

    html.jw-phone .territory-entry dl {
      grid-template-columns: 94px minmax(0, 1fr);
    }


    /* === DOSTOSOWANIE 22.11: telefony, tablety i nawigacja === */
    /* Akcent dla „Moje zadania” niezależny od urządzenia i stanu zakładki. */
    #tab-my {
      background: #d6eaf1;
      border: 2px solid #47809a;
      color: #163c52;
      font-weight: 800;
    }

    #tab-my[aria-pressed="true"] {
      background: #145b78;
      border-color: #145b78;
      color: #fff;
      box-shadow: 0 2px 7px rgba(20, 91, 120, .18);
    }

    /* Tablet: mniejsze wyłącznie zakładki. Sterowanie tygodniem bez zmian. */
    html.jw-tablet .view-tab {
      font-size: 14px;
      min-height: 50px;
      padding: 7px 6px;
      line-height: 1.18;
    }

    html.jw-tablet .view-tabs {
      gap: 6px;
      padding: 6px 0;
    }

    /* Telefon: 2 x większe litery w zakładkach (19px -> 38px).
       Panel może się przewijać osobno, aby nie zakrywać całej treści. */
    html.jw-phone .view-tabs {
      /* Dwie kolumny na wąskim telefonie: font 38px musi mieć miejsce. */
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 5px;
      padding: 6px 0;
      max-height: 33dvh;
      overflow-y: auto;
      overflow-x: hidden;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      align-content: start;
    }

    @media (min-width: 560px) {
      html.jw-phone .view-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    html.jw-phone .view-tab,
    html.jw-phone-compact .view-tab {
      font-size: 38px;
      min-height: 118px;
      padding: 10px 3px;
      line-height: 1.07;
      overflow-wrap: anywhere;
      word-break: normal;
      align-self: stretch;
    }

    /* Pasek tygodni: poszerzona graficznie 3-krotnie strzałka,
       przycisk „Aktualny tydzień” wypełnia pozostałe miejsce. */
    html.jw-phone #program-view .week-navigation {
      grid-template-columns: 48px minmax(0, 1.20fr) 48px minmax(110px, 1fr) !important;
      grid-template-rows: 116px !important;
      gap: 4px !important;
    }

    html.jw-phone #program-view .week-navigation>* {
      height: 116px !important;
      min-height: 116px !important;
    }

    html.jw-phone #program-view .week-navigation .nav-icon {
      overflow: hidden;
      padding: 0 !important;
    }

    html.jw-phone #program-view .week-navigation .nav-icon svg {
      width: 36px !important;
      height: 46px !important;
      overflow: visible;
    }

    html.jw-phone #program-view .week-navigation .nav-icon svg path {
      transform: scaleX(3);
      transform-origin: 50% 50%;
      stroke-width: 2.1;
    }

    html.jw-phone #program-view #current-week {
      font-size: 30px !important;
      font-weight: 800 !important;
      line-height: 1.02 !important;
      overflow-wrap: anywhere !important;
      white-space: normal !important;
      padding: 5px 2px !important;
    }

    /* Pełna data (np. 23.11.2026) i czytelna czcionka. */
    html.jw-phone #program-view #week {
      font-size: 24px !important;
    }

    html.jw-phone-compact #program-view .week-navigation {
      grid-template-columns: 40px minmax(0, 1.15fr) 40px minmax(91px, 1fr) !important;
      gap: 3px !important;
    }

    html.jw-phone-compact #program-view #week {
      font-size: 19px !important;
    }

    html.jw-phone-compact #program-view #current-week {
      font-size: 26px !important;
    }

    html.jw-phone-compact #program-view .week-navigation .nav-icon svg {
      width: 31px !important;
      height: 42px !important;
    }

    /* Tereny: wyłącznie jedna tabela (bez drugich, wysokich kart).
       Na telefonie font +50% z 17 do 25.5px. */
    .territory-card-list {
      display: none !important;
    }

    html.jw-phone .territory-table-scroll,
    .territory-table-scroll {
      display: block !important;
    }

    html.jw-phone .territory-table {
      font-size: 25.5px;
      min-width: 1480px;
    }

    html.jw-phone .territory-table th,
    html.jw-phone .territory-table td {
      font-size: 25.5px;
      padding: 15px 12px;
      line-height: 1.35;
    }

    html.jw-phone .territory-summary {
      font-size: 27px;
    }

    html.jw-phone .territory-meta {
      font-size: 19.5px;
    }

    html.jw-phone #territories-view .extra-controls input,
    html.jw-phone #territories-view .extra-controls select {
      font-size: 27px;
    }

    html.jw-phone #territories-view .territory-more {
      font-size: 24px;
      min-height: 66px;
    }


    /* === JW OLIWA — korekty telefonu: pełna data, trzykolumnowy pasek, nowe wielkości === */
    /* „Tydzień od”: 36px -> 43.2px (+20%), pogrubienie. */
    html.jw-phone #program-view label[for="week"] {
      font-size: 43.2px !important;
      line-height: 1.15 !important;
      font-weight: 800 !important;
    }

    /* Strzałki: 3 x 42px = 126px na standardowym telefonie.
       Na najwęższych ekranach szerokość redukuje się automatycznie,
       żeby został czytelny środek z pełną datą. */
    html.jw-phone #program-view .toolbar .control {
      width: 100% !important;
      min-width: 0 !important;
      flex: 1 1 100% !important;
    }

    html.jw-phone #program-view .week-navigation {
      display: grid !important;
      grid-template-columns: clamp(92px, 32vw, 126px) minmax(0, 1fr) clamp(92px, 32vw, 126px) !important;
      grid-template-rows: 100px 78px !important;
      gap: 6px !important;
      width: 100% !important;
      align-items: stretch !important;
    }

    html.jw-phone #program-view .week-navigation>* {
      min-width: 0 !important;
      width: 100% !important;
      min-height: 0 !important;
      margin: 0 !important;
      box-sizing: border-box !important;
    }

    html.jw-phone #program-view #prev-week,
    html.jw-phone #program-view #next-week {
      height: 100px !important;
      min-height: 100px !important;
      grid-row: 1 !important;
      padding: 0 !important;
      border-radius: 14px !important;
    }

    html.jw-phone #program-view #prev-week {
      grid-column: 1 !important;
    }

    html.jw-phone #program-view #next-week {
      grid-column: 3 !important;
    }

    html.jw-phone #program-view .week-navigation .nav-icon svg {
      width: 54px !important;
      height: 54px !important;
      overflow: visible !important;
    }

    /* Starszy CSS zwiększał szerokość samego grotu; teraz zwiększamy PRZYCISK. */
    html.jw-phone #program-view .week-navigation .nav-icon svg path {
      transform: none !important;
      stroke-width: 2.3 !important;
    }

    html.jw-phone #program-view #week {
      grid-column: 2 !important;
      grid-row: 1 !important;
      height: 100px !important;
      min-height: 100px !important;
      font-size: 19px !important;
      position: relative !important;
      z-index: 1 !important;
      cursor: pointer !important;
      border-radius: 14px !important;
    }

    /* Nakładka tekstowa jest nieklikalna; pod nią jest natywna lista wyboru tygodnia. */
    .week-readable-date {
      display: none;
    }

    html.jw-phone #program-view #week-readable-date {
      display: flex !important;
      grid-column: 2 !important;
      grid-row: 1 !important;
      align-items: center !important;
      justify-content: center !important;
      text-align: center !important;
      font-size: 19px !important;
      font-weight: 800 !important;
      line-height: 1.1 !important;
      white-space: normal !important;
      overflow-wrap: anywhere !important;
      padding: 6px 2px !important;
      height: 100px !important;
      min-height: 100px !important;
      background: #fff !important;
      border: 1px solid #d8e0ea !important;
      border-radius: 14px !important;
      pointer-events: none !important;
      z-index: 2 !important;
    }

    html.jw-phone #program-view #current-week {
      grid-column: 1 / -1 !important;
      grid-row: 2 !important;
      height: 78px !important;
      min-height: 78px !important;
      width: 100% !important;
      font-size: 30px !important;
      font-weight: 800 !important;
      border-radius: 14px !important;
      line-height: 1.12 !important;
      padding: 6px 12px !important;
    }

    html.jw-phone-compact #program-view .week-navigation {
      grid-template-columns: clamp(88px, 31vw, 108px) minmax(0, 1fr) clamp(88px, 31vw, 108px) !important;
      grid-template-rows: 100px 78px !important;
    }

    html.jw-phone-compact #program-view #week-readable-date {
      font-size: 16px !important;
    }

    /* Telefon: 2 x większa treść trzech zakładek (BEZ powiększania zakładek na tablecie). */
    html.jw-phone #groups-view .extra-page-title,
    html.jw-phone #pioneers-view .extra-page-title,
    html.jw-phone #duties-view .extra-page-title {
      font-size: 46px !important;
    }

    html.jw-phone #groups-view .extra-card,
    html.jw-phone #pioneers-view .extra-card {
      font-size: 38px !important;
    }

    html.jw-phone #groups-view .extra-card h2,
    html.jw-phone #pioneers-view .extra-card h2 {
      font-size: 46px !important;
    }

    html.jw-phone #groups-view .extra-card h3,
    html.jw-phone #pioneers-view .extra-card h3 {
      font-size: 36px !important;
    }

    html.jw-phone #groups-view .extra-role strong,
    html.jw-phone #pioneers-view .extra-role strong {
      font-size: 32px !important;
    }

    html.jw-phone #groups-view .extra-members,
    html.jw-phone #pioneers-view .extra-members {
      font-size: 36px !important;
    }

    html.jw-phone #groups-view .extra-summary,
    html.jw-phone #pioneers-view .extra-summary {
      font-size: 40px !important;
    }

    html.jw-phone #duties-view .extra-table th,
    html.jw-phone #duties-view .extra-table td {
      font-size: 34px !important;
      line-height: 1.24 !important;
    }

    html.jw-phone #groups-view .extra-status,
    html.jw-phone #pioneers-view .extra-status,
    html.jw-phone #duties-view .extra-status {
      font-size: 30px !important;
    }

    /* Tereny na telefonie: kolumny dopasowane w 2026-11.
       Opis 290px, Wolny/Zajęty 110px, Kto 208px. */
    html.jw-phone #territories-view .territory-table {
      table-layout: fixed !important;
      width: 1511px !important;
      min-width: 1511px !important;
    }

    html.jw-phone #territories-view .territory-table th:nth-child(1) {
      width: 137px;
    }

    html.jw-phone #territories-view .territory-table th:nth-child(2) {
      width: 290px;
    }

    /* Opis: +30% */
    html.jw-phone #territories-view .territory-table th:nth-child(3) {
      width: 110px;
    }

    /* Status: -50% */
    html.jw-phone #territories-view .territory-table th:nth-child(4) {
      width: 208px;
    }

    /* Kto: >= 10 liter */
    html.jw-phone #territories-view .territory-table th:nth-child(5) {
      width: 279px;
    }

    html.jw-phone #territories-view .territory-table th:nth-child(6) {
      width: 287px;
    }

    html.jw-phone #territories-view .territory-table th:nth-child(7) {
      width: 200px;
    }

    html.jw-phone #territories-view .territory-table td:nth-child(4) {
      word-break: normal !important;
      overflow-wrap: normal !important;
      white-space: normal;
    }


    /* ===== Wersja 23.11: pasek tygodnia w jednej linii, stałe szerokości strzałek ===== */
    .week-navigation-scroll {
      display: contents;
    }

    .week-inline-label {
      display: none;
    }

    /* Na telefonie szerokości strzałek pozostają dokładnie takie jak wcześniej.
       Wszystkie pięć elementów jest w jednym POZIOMYM rzędzie. Ponieważ przyciski
       nie zmieszczą się na ekranie o szerokości ~393px, pasek przewija się w bok. */
    html.jw-phone #program-view .control>label[for="week"] {
      display: none !important;
    }

    html.jw-phone #program-view .toolbar .control {
      min-width: 0 !important;
    }

    html.jw-phone #program-view .week-navigation-scroll {
      display: block;
      width: 100%;
      min-width: 0;
      max-width: 100%;
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-x: contain;
      scrollbar-width: thin;
      scrollbar-color: #7b92a8 #e4ebf3;
      border-radius: 13px;
    }

    html.jw-phone #program-view .week-navigation {
      display: grid !important;
      grid-template-columns:
        max-content clamp(92px, 32vw, 126px) 210px clamp(92px, 32vw, 126px) 245px !important;
      grid-template-rows: 88px !important;
      width: max-content !important;
      min-width: 100% !important;
      gap: 6px !important;
      align-items: stretch !important;
    }

    html.jw-phone #program-view .week-navigation>* {
      grid-row: 1 !important;
      height: 88px !important;
      min-height: 88px !important;
      box-sizing: border-box;
      min-width: 0 !important;
    }

    html.jw-phone #program-view .week-navigation .week-inline-label {
      display: flex !important;
      grid-column: 1 !important;
      align-items: center;
      padding: 0 9px 0 2px;
      font-size: 43.2px !important;
      font-weight: 800 !important;
      color: #35495e;
      white-space: nowrap !important;
      width: max-content !important;
      border: 0;
    }

    html.jw-phone #program-view #prev-week {
      grid-column: 2 !important;
    }

    html.jw-phone #program-view #week,
    html.jw-phone #program-view #week-readable-date {
      grid-column: 3 !important;
    }

    html.jw-phone #program-view #next-week {
      grid-column: 4 !important;
    }

    html.jw-phone #program-view #current-week {
      grid-column: 5 !important;
    }

    html.jw-phone #program-view #prev-week,
    html.jw-phone #program-view #next-week,
    html.jw-phone #program-view #week,
    html.jw-phone #program-view #week-readable-date,
    html.jw-phone #program-view #current-week {
      grid-row: 1 !important;
      height: 88px !important;
      min-height: 88px !important;
      width: 100% !important;
    }

    html.jw-phone #program-view #week-readable-date {
      white-space: nowrap !important;
      font-size: 19px !important;
      overflow-wrap: normal !important;
      padding: 4px 6px !important;
    }

    html.jw-phone #program-view #current-week {
      white-space: nowrap !important;
      overflow-wrap: normal !important;
      font-size: 30px !important;
    }

    html.jw-phone #program-view #week-position,
    html.jw-phone #program-view #status {
      position: absolute !important;
      width: 1px !important;
      height: 1px !important;
      padding: 0 !important;
      margin: -1px !important;
      overflow: hidden !important;
      clip-path: inset(50%) !important;
      white-space: nowrap !important;
    }

    /* Wąski telefon: nie zmieniamy szerokości przycisków względem poprzedniej wersji. */
    html.jw-phone-compact #program-view .week-navigation {
      grid-template-columns:
        max-content clamp(88px, 31vw, 108px) 210px clamp(88px, 31vw, 108px) 245px !important;
    }

    /* ===== Tereny: wyszukiwarka i nagłówek stale widoczne przy przewijaniu ===== */
    /* Przewija się tylko wnętrze tabeli; panel filtrów pozostaje nad nim,
       a thead przykleja się do górnej krawędzi przewijanego obszaru. */
    #territories-view:not([hidden]) {
      display: flex !important;
      flex-direction: column;
      position: sticky;
      top: var(--jw-tabs-sticky-height, 0px);
      z-index: 50;
      background: #f4f6f9;
      height: calc(100dvh - var(--jw-tabs-sticky-height, 0px) - 12px);
      min-height: 360px;
      min-width: 0;
    }

    #territories-view #territories-status {
      flex: 0 0 auto;
    }

    #territories-view #territories-content {
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
      min-width: 0;
      min-height: 0;
    }

    #territories-view .territory-summary,
    #territories-view .territory-meta,
    #territories-view .territory-more {
      flex: 0 0 auto;
    }

    #territories-view .extra-controls {
      flex: 0 0 auto;
      position: relative;
      z-index: 5;
      background: #f4f6f9;
      padding: 6px 0;
      margin: 6px 0;
    }

    #territories-view .territory-table-scroll {
      display: block !important;
      flex: 1 1 auto;
      min-height: 130px;
      width: 100%;
      overflow-x: auto !important;
      overflow-y: auto !important;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      border: 1px solid #aebccc;
      border-radius: 9px;
      background: #fff;
      position: relative;
    }

    #territories-view .territory-table {
      border-collapse: separate;
      border-spacing: 0;
    }

    #territories-view .territory-table thead th {
      position: sticky !important;
      top: 0 !important;
      z-index: 6 !important;
      background: #dbe5f1 !important;
      box-shadow: 0 2px 0 #879bb0;
    }

    #territories-view .territory-more {
      margin: 8px auto;
    }

    /* Telefon: wyszukiwanie i filtr statusu obok siebie, zamiast w dwóch rzędach. */
    html.jw-phone #territories-view .extra-controls {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 132px;
      gap: 5px;
      align-items: stretch;
    }

    html.jw-phone #territories-view .extra-controls input,
    html.jw-phone #territories-view .extra-controls select {
      width: 100%;
      min-width: 0 !important;
      flex: none;
      padding: 8px 4px;
    }

    html.jw-phone #territories-view .extra-controls select {
      font-size: 20px !important;
    }

    /* Podsumowanie na telefonie nie zabiera 4–5 wierszy nad tabelą.
       Pozostaje dostępne w całości po przesunięciu poziomym. */
    html.jw-phone #territories-view .territory-summary,
    html.jw-phone #territories-view .territory-meta {
      white-space: nowrap;
      overflow-x: auto;
      overflow-y: hidden;
      max-width: 100%;
      scrollbar-width: thin;
    }

    /* ===== Grupy służby: numer listy nigdy nie wychodzi poza kartę ===== */
    #groups-view .extra-members {
      list-style-position: inside;
      padding-left: 0 !important;
      margin-left: 0 !important;
      max-width: 100%;
      min-width: 0;
    }

    #groups-view .extra-members li {
      max-width: 100%;
      box-sizing: border-box;
      overflow-wrap: anywhere;
      padding-left: 5px;
    }


    /* ===== DOPASOWANIE 24.11 — teren i nawigacja ===== */
    /* Na telefonie podwójny rozmiar daty nakładanej nad select (19 -> 38 px).
       Strzałki zachowują dokładnie dotychczasowe szerokości; przewijanie w bok bez zmian. */
    html.jw-phone #program-view #week-readable-date,
    html.jw-phone-compact #program-view #week-readable-date {
      font-size: 38px !important;
      font-weight: 800 !important;
      letter-spacing: -.4px !important;
      white-space: nowrap !important;
    }

    /* Przeglądanie terenów: przyklejona wyszukiwarka i nagłówki pozostają.
       Statystyki nie zajmują miejsca, kiedy użytkownik przewija tabelę. */
    #territories-view.territory-scrolled .territory-summary,
    #territories-view.territory-scrolled .territory-meta-generated {
      display: none !important;
    }

    /* Usuń pustą przestrzeń nad wyszukiwarką */
    #territories-view.territory-scrolled #territories-status:empty {
      display: none !important;
    }

    #territories-view.territory-scrolled .extra-controls {
      margin-top: 0 !important;
      padding-top: 0 !important;
    }

    /* Zmniejsz odstęp pod przyciskami nawigacyjnymi */
    html.jw-table-scrolled .view-tabs {
      margin-bottom: 4px !important;
    }

    /* Zwinięcie dziewięciu zakładek do małego paska w trakcie przewijania terenów.
       Przycisk jest zawsze dostępny, aby przywrócić pełną nawigację. */
    .view-tabs .territories-nav-expand {
      display: none !important;
    }

    html.jw-territories-nav-collapsed .view-tabs {
      display: flex !important;
      flex-direction: row !important;
      flex-wrap: nowrap !important;
      align-items: center !important;
      max-height: 50px !important;
      min-height: 42px !important;
      overflow: hidden !important;
      padding: 4px 0 !important;
      margin-bottom: 8px !important;
      gap: 0 !important;
    }

    html.jw-territories-nav-collapsed .view-tabs .view-tab {
      display: none !important;
    }

    html.jw-territories-nav-collapsed .view-tabs .territories-nav-expand {
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      gap: 8px;
      height: 38px;
      min-height: 38px;
      width: 100%;
      padding: 5px 12px;
      font-size: 15px !important;
      font-weight: 750;
      border: 1px solid #b3c2d3;
      color: #253e5b;
      background: #e4edf5;
      border-radius: 9px;
    }

    /* Pole wyszukiwania terenów z przyciskiem X */
    #territories-view .territory-search-wrap {
      position: relative;
      flex: 1 1 235px;
      min-width: 0;
    }

    #territories-view .territory-search-wrap input {
      width: 100%;
      padding-right: 48px !important;
    }

    #territories-view .territory-search-clear {
      position: absolute;
      right: 5px;
      top: 50%;
      transform: translateY(-50%);

      width: 40px;
      height: 40px;
      padding: 0;

      border: none;
      border-radius: 8px;
      background: #e1e8f0;
      color: #34465a;

      font-size: 30px;
      font-weight: 600;
      line-height: 1;
      cursor: pointer;
    }

    #territories-view .territory-search-clear[hidden] {
      display: none !important;
    }

    #territories-view input[type="search"]::-webkit-search-cancel-button {
      display: none;
    }

    /* === Zakres dat tygodnia bez etykiety „Tydzień od” ===
       Wyłącznie telefon: cztery elementy i dotychczasowe szerokości strzałek.
       Długi zakres miesiąca przewija się poziomo razem z paskiem. */
    html.jw-phone #program-view .week-navigation {
      grid-template-columns:
        clamp(92px, 32vw, 126px) minmax(370px, max-content) clamp(92px, 32vw, 126px) 245px !important;
    }

    html.jw-phone-compact #program-view .week-navigation {
      grid-template-columns:
        clamp(88px, 31vw, 108px) minmax(370px, max-content) clamp(88px, 31vw, 108px) 245px !important;
    }

    html.jw-phone #program-view #prev-week {
      grid-column: 1 !important;
    }

    html.jw-phone #program-view #week,
    html.jw-phone #program-view #week-readable-date {
      grid-column: 2 !important;
    }

    html.jw-phone #program-view #next-week {
      grid-column: 3 !important;
    }

    html.jw-phone #program-view #current-week {
      grid-column: 4 !important;
    }

    html.jw-phone #program-view #week-readable-date {
      white-space: nowrap !important;
      overflow-wrap: normal !important;
      padding-inline: 8px !important;
    }

    /* Na tablecie i komputerze dłuższy opis tygodnia bez ucinania, jeśli jest miejsce. */
    #program-view #week {
      text-overflow: clip;
    }

    /* GRAFIK ZEBRAŃ — telefon: bez sztucznego łamania po nazwie punktu.
       Nazwa punktu oraz osoba są obok siebie, jeśli rzeczywiście się mieszczą.
       Dłuższe treści przechodzą do kolejnego wiersza w naturalny sposób. */
    /* Kilka dodatkowych pikseli na treść bez zmiany rozmiaru czcionki. */
    html.jw-phone #program-view .item {
      column-gap: 6px !important;
    }

    html.jw-phone #program-view .item>.num {
      flex: 0 0 28px !important;
    }

    html.jw-phone #program-view .item-main {
      display: flex !important;
      flex-flow: row wrap !important;
      justify-content: space-between !important;
      align-items: flex-start !important;
      gap: 4px !important;
      min-width: 0 !important;
    }

    html.jw-phone #program-view .item-main>.task,
    html.jw-phone #program-view .item-main>.person {
      flex: 0 0 auto !important;
      max-width: 100% !important;
      min-width: 0 !important;
    }

    html.jw-phone #program-view .item-main>.task {
      margin-bottom: 0 !important;
      overflow-wrap: break-word;
    }

    html.jw-phone #program-view .item-main>.person {
      margin-left: auto !important;
      text-align: right !important;
      overflow-wrap: break-word !important;
    }

    /* JW Oliwa: kontrast nawigacji, kompaktowy tryb przewijania i numery punktów. */
    .view-tabs,
    html.jw-phone .view-tabs,
    html.jw-tablet .view-tabs {
      background: #dce7f2;
      border: 1px solid #b5c7da;
      border-radius: 0 0 12px 12px;
      padding: 8px;
      box-shadow: 0 4px 10px rgba(25, 50, 80, .14);
    }

    #program-view .item>.num {
      white-space: nowrap !important;
      overflow-wrap: normal !important;
      word-break: normal !important;
    }

    html.jw-phone #program-view .item>.num {
      flex: 0 0 2ch !important;
      min-width: 2.6ch !important;
    }

    html.jw-page-scrolled .view-tab,
    html.jw-table-scrolled .view-tab {
      min-height: 31px !important;
      padding: 3px 5px !important;
      font-size: 13px !important;
      line-height: 1.12 !important;
      height: auto !important;
    }

    html.jw-tablet.jw-page-scrolled .view-tab,
    html.jw-tablet.jw-table-scrolled .view-tab {
      min-height: 25px !important;
      font-size: 12px !important;
    }

    html.jw-phone.jw-page-scrolled .view-tab,
    html.jw-phone.jw-table-scrolled .view-tab {
      min-height: 59px !important;
      font-size: 19px !important;
    }

    html.jw-page-scrolled .view-tabs,
    html.jw-table-scrolled .view-tabs {
      padding: 4px !important;
      gap: 4px !important;
    }

    /* Stabilne przewijanie bez automatycznej korekty pozycji */
    html,
    body,
    #app-shell {
      overflow-anchor: none;
      scroll-behavior: auto;
    }

    /* Bez animowania wysokości nawigacji */
    .view-tabs,
    .view-tab,
    #program-view .toolbar {
      transition: none !important;
    }

    /* Pozwól na naturalne przewijanie dotykowe */
    html.jw-phone .view-tabs {
      overscroll-behavior-y: auto;
    }

    /* Zmniejszenie również wysokości całego panelu */
    html.jw-phone.jw-page-scrolled .view-tabs {
      max-height: 16.5dvh;
    }

    /* Kolor nieaktywnych zakładek */
    .view-tab[aria-pressed="false"] {
      background: #d3e2d5 !important;
      border-color: #c0cddd !important;
      color: #253e5b !important;
    }

    /* Kolor po najechaniu kursorem */
    .view-tab[aria-pressed="false"]:hover {
      background: #cbd7e5 !important;
    }
    /* === OVH: natywny viewport telefonu, bez kompensacji iframe Apps Script === */
    html.jw-phone {
      --mobile-text-multiplier: 1;
      --font-scale-mobile: 1.1;
      --font-scale: var(--font-scale-mobile);
    }
    html.jw-phone .shell { padding: 12px 10px 28px; }
    html.jw-phone header { gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
    html.jw-phone .header-actions { gap: 6px; }
    html.jw-phone .header-actions button { min-height: 44px; padding: 8px 10px; font-size: 14px; }
    html.jw-phone .auth-shell { margin: 8vh 12px; padding: 20px; }
    html.jw-phone .auth-login { min-height: 44px; }
    /* Telefon OVH: rzeczywista wysokość zakładek 48 -> 28.8 px (-40%).
       Zmienna 0..1 jest aktualizowana w requestAnimationFrame przy scrollu.
       Szerokość kolumn pozostaje stała, żeby układ nie przeskakiwał. */
    html.jw-phone .view-tabs {
      --jw-nav-row: calc(48px - 19.2px * var(--jw-nav-progress, 0));
      --jw-nav-font: calc(14px - 2.5px * var(--jw-nav-progress, 0));
      grid-template-columns: repeat(3, minmax(0, 1fr));
      grid-auto-rows: var(--jw-nav-row);
      gap: calc(5px - 2px * var(--jw-nav-progress, 0)) !important;
      padding: calc(6px - 2.4px * var(--jw-nav-progress, 0)) !important;
      margin-bottom: calc(10px - 4px * var(--jw-nav-progress, 0)) !important;
      max-height: none !important;
      overflow: visible;
    }
    html.jw-phone.jw-phone-compact .view-tabs {
      --jw-nav-font: calc(13px - 1.5px * var(--jw-nav-progress, 0));
    }
    html.jw-phone .view-tabs .view-tab {
      height: var(--jw-nav-row) !important;
      min-height: var(--jw-nav-row) !important;
      font-size: var(--jw-nav-font) !important;
      padding: calc(3px - 2px * var(--jw-nav-progress, 0)) 2px !important;
      border-radius: calc(9px - 3.6px * var(--jw-nav-progress, 0));
      line-height: 1.05 !important;
      overflow-wrap: anywhere;
      word-break: normal;
    }
    /* Reguły kompaktowe ze starszej wersji nie mogą nadpisywać interpolacji. */
    html.jw-phone.jw-page-scrolled .view-tabs,
    html.jw-phone.jw-table-scrolled .view-tabs {
      max-height: none !important;
      gap: calc(5px - 2px * var(--jw-nav-progress, 0)) !important;
      padding: calc(6px - 2.4px * var(--jw-nav-progress, 0)) !important;
      margin-bottom: calc(10px - 4px * var(--jw-nav-progress, 0)) !important;
    }
    html.jw-phone #program-view .toolbar { padding: 5px 0 7px; margin-bottom: 10px; }
    html.jw-phone #program-view .week-navigation-scroll { overflow-x: visible; }
    html.jw-phone #program-view .week-navigation {
      grid-template-columns: 44px minmax(0, 1fr) 44px minmax(78px, .72fr) !important;
      grid-template-rows: 52px !important;
      gap: 4px !important; width: 100% !important; min-width: 0 !important;
    }
    html.jw-phone #program-view .week-navigation > *,
    html.jw-phone #program-view #prev-week,
    html.jw-phone #program-view #next-week,
    html.jw-phone #program-view #week,
    html.jw-phone #program-view #week-readable-date,
    html.jw-phone #program-view #current-week {
      height: 52px !important; min-height: 52px !important; border-radius: 9px !important;
    }
    html.jw-phone #program-view #prev-week,
    html.jw-phone #program-view #next-week { padding: 0 !important; }
    html.jw-phone #program-view .week-navigation .nav-icon svg {
      width: 25px !important; height: 25px !important;
    }
    html.jw-phone #program-view #week { font-size: 16px !important; }
    html.jw-phone #program-view #week-readable-date {
      font-size: 14px !important; font-weight: 700 !important;
      white-space: normal !important; overflow-wrap: normal !important;
      letter-spacing: 0 !important; padding: 3px !important; line-height: 1.15 !important;
    }
    html.jw-phone #program-view #current-week {
      font-size: 13px !important; font-weight: 700 !important;
      white-space: normal !important; overflow-wrap: normal !important; padding: 3px !important;
    }
    html.jw-phone #program-view .item { padding: 10px 12px; column-gap: 8px !important; }
    html.jw-phone #program-view .item > .num { flex: 0 0 2.6ch !important; min-width: 2.6ch !important; }
    html.jw-phone .card { margin: 10px 0; }
    html.jw-phone .card-head { padding: 13px; }
    html.jw-phone .group-head { padding: 10px 12px 6px; }
    html.jw-phone .ministry-entry, html.jw-phone .my-entry, html.jw-phone .calendar-entry { padding: 12px; margin: 8px 0; }
    html.jw-phone .ministry-detail { grid-template-columns: 90px minmax(0, 1fr); gap: 5px 8px; }
    html.jw-phone .ministry-detail-label:not(:first-child) { margin-top: 0; }
    html.jw-phone .extra-card { padding: 12px; }
    html.jw-phone #groups-view .extra-page-title,
    html.jw-phone #pioneers-view .extra-page-title,
    html.jw-phone #duties-view .extra-page-title { font-size: 21px !important; margin: 10px 0 12px; }
    html.jw-phone #groups-view .extra-card,
    html.jw-phone #pioneers-view .extra-card { font-size: 16px !important; }
    html.jw-phone #groups-view .extra-card h2,
    html.jw-phone #pioneers-view .extra-card h2 { font-size: 20px !important; }
    html.jw-phone #groups-view .extra-card h3,
    html.jw-phone #pioneers-view .extra-card h3 { font-size: 17px !important; }
    html.jw-phone #groups-view .extra-role strong,
    html.jw-phone #pioneers-view .extra-role strong { font-size: 13px !important; }
    html.jw-phone #groups-view .extra-members,
    html.jw-phone #pioneers-view .extra-members { font-size: 16px !important; }
    html.jw-phone #groups-view .extra-summary,
    html.jw-phone #pioneers-view .extra-summary { font-size: 17px !important; }
    html.jw-phone #duties-view .extra-table th,
    html.jw-phone #duties-view .extra-table td { font-size: 15px !important; padding: 9px 7px; }
    html.jw-phone #groups-view .extra-status,
    html.jw-phone #pioneers-view .extra-status,
    html.jw-phone #duties-view .extra-status { font-size: 14px !important; }
    html.jw-phone #territories-view .territory-table { width: 960px !important; min-width: 960px !important; font-size: 14px; }
    html.jw-phone #territories-view .territory-table th,
    html.jw-phone #territories-view .territory-table td { font-size: 14px; padding: 9px 7px; line-height: 1.35; }
    html.jw-phone #territories-view .territory-table th:nth-child(1) { width: 80px; }
    html.jw-phone #territories-view .territory-table th:nth-child(2) { width: 185px; }
    html.jw-phone #territories-view .territory-table th:nth-child(3) { width: 92px; }
    html.jw-phone #territories-view .territory-table th:nth-child(4) { width: 145px; }
    html.jw-phone #territories-view .territory-table th:nth-child(5) { width: 145px; }
    html.jw-phone #territories-view .territory-table th:nth-child(6) { width: 190px; }
    html.jw-phone #territories-view .territory-table th:nth-child(7) { width: 123px; }
    html.jw-phone #territories-view .territory-summary { font-size: 15px; }
    html.jw-phone #territories-view .territory-meta { font-size: 12px; }
    html.jw-phone #territories-view .extra-controls { grid-template-columns: minmax(0, 1fr) 104px; }
    html.jw-phone #territories-view .extra-controls input,
    html.jw-phone #territories-view .extra-controls select { font-size: 16px !important; min-height: 44px; }
    html.jw-phone #territories-view .territory-more { font-size: 14px; min-height: 44px; }
    html.jw-phone #territories-view .territory-search-clear { font-size: 24px; width: 34px; height: 34px; }
    html.jw-phone #territories-view .territory-search-wrap input { padding-right: 42px !important; }
    html.jw-phone #territories-view:not([hidden]) { min-height: 260px; }
    /* iOS nie powiększa automatycznie widoku podczas edycji pól >=16px. */
    html.jw-phone input, html.jw-phone select { font-size: 16px; }
    @media (max-width: 350px) {
      html.jw-phone #program-view .week-navigation { grid-template-columns: 40px minmax(0, 1fr) 40px minmax(72px, .7fr) !important; }
      html.jw-phone #program-view #week-readable-date { font-size: 13px !important; }
    }
      /* Kolory punktów zgodne z wypełnieniem B w grafiku, z kontrastowym tekstem. */
    #program-view .item.sheet-point-color {
      background: var(--sheet-point-bg);
      color: var(--sheet-point-fg);
    }
    #program-view .item.sheet-point-color :is(.num,.task,.person,.helper,.additional,.empty) {
      color: var(--sheet-point-fg);
    }
    /* Pomocnicy pod osobą przydzieloną, w tej samej prawej kolumnie. */
    #program-view .assignment-people {
      min-width: 0;
      max-width: 100%;
      margin-left: auto;
      text-align: right;
      overflow-wrap: anywhere;
    }
    #program-view .assignment-people .helper {
      margin-top: 4px;
      text-align: right;
      overflow-wrap: anywhere;
    }
    /* Grafik zebrań: stałe dwie kolumny, bez nagłówków.
       Linia oddziela zadanie od przydziału na całej wysokości wiersza. */
    #program-view .item.schedule-assignment {
      --schedule-row-padding: 13px;
      padding-block: 0 !important;
      align-items: stretch;
    }
    #program-view .item.schedule-assignment > .num {
      padding-top: calc(var(--schedule-row-padding) + 1px);
    }
    #program-view .item.schedule-assignment > .item-main {
      display: grid !important;
      grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
      align-items: stretch !important;
      gap: 0 !important;
    }
    #program-view .item.schedule-assignment .item-main > .task,
    #program-view .item.schedule-assignment .item-main > .assignment-people {
      min-width: 0 !important;
      max-width: 100% !important;
      margin: 0 !important;
      padding-block: var(--schedule-row-padding);
      overflow-wrap: anywhere !important;
    }
    #program-view .item.schedule-assignment .item-main > .task {
      padding-right: 10px;
    }
    #program-view .item.schedule-assignment .item-main > .assignment-people {
      border-left: 1px solid #9eafc2;
      padding-left: 10px;
      text-align: right !important;
      align-self: stretch;
    }
    html.jw-phone #program-view .item.schedule-assignment {
      --schedule-row-padding: 10px;
    }
    html.jw-phone #program-view .item.schedule-assignment > .item-main {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    html.jw-phone #program-view .item.schedule-assignment .item-main > .task {
      padding-right: 7px;
    }
    html.jw-phone #program-view .item.schedule-assignment .item-main > .assignment-people {
      padding-left: 7px;
    }

