/* Applied only to markup rendered for iPhones, including landscape. */
.iphone-browse{padding:14px max(16px,env(safe-area-inset-left)) 28px}
.iphone-browse-controls{display:grid;gap:8px}
.iphone-browse-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
.iphone-subject-trigger,.iphone-filter-trigger{display:flex;align-items:center;gap:8px;min-width:0;min-height:48px;padding:6px 10px;border:1px solid #bdd3c5;border-radius:10px;background:#fff;color:var(--ink);font-family:Andika,Arial,sans-serif;font-size:14px;line-height:1.35;text-align:left;touch-action:manipulation}
.iphone-subject-trigger{width:100%}
.iphone-subject-trigger img{width:30px;height:30px;flex-shrink:0;object-fit:contain}
.iphone-subject-trigger>span:not(.iphone-subject-chevron){flex:1;min-width:0;overflow-wrap:anywhere}
.iphone-subject-chevron{flex-shrink:0;font-size:18px}
.iphone-filter-trigger{background:#e6f5ef;justify-content:center}
.iphone-filter-trigger svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.iphone-subject-trigger[aria-expanded=true],.iphone-filter-trigger[aria-expanded=true]{background:#d8f3cd;border-color:#75aa64}
.iphone-browse .catalogue-section{margin:12px 0 0;padding:8px 0 0;border-top:1px solid var(--line)}
.iphone-browse .catalogue-heading{display:block;margin-bottom:0}
.iphone-browse .catalogue-tools{display:flex;flex-wrap:wrap;gap:4px 8px;justify-content:space-between}
.iphone-browse #sort{flex:1 1 140px;min-width:0;max-width:100%;min-height:44px;padding:6px 26px 6px 8px;border-radius:7px;font-size:13px}
.iphone-browse .catalogue-views{width:auto;flex:0 0 auto;gap:2px}
.iphone-browse .catalogue-views button{flex:initial;min-width:44px;font-size:11px;padding:0 6px}
.iphone-browse .results-line{align-items:center;min-height:36px;margin:4px 0 8px;font-size:12px}
.iphone-top-link{display:inline-flex;align-items:center;min-height:44px;padding:2px 6px;text-decoration:underline;text-underline-offset:3px}
.iphone-browse .search-selections{margin-top:0}
.iphone-browse .search-filter-chip{font-size:12px}

/* Subjects slide up together, with no staggered icon animation. */
.subject-picker.iphone-subject-sheet{border-radius:22px 22px 0 0;border-bottom:0;transform-origin:center bottom;box-shadow:0 -10px 45px #183c3d22;padding-bottom:env(safe-area-inset-bottom,0px)}
.iphone-subject-sheet::backdrop{background:#183c3d55}
.iphone-subject-sheet::before,.iphone-sheet-handle{content:'';display:block;flex-shrink:0;width:36px;height:4px;margin:10px auto 2px;border-radius:4px;background:#b8c8be}
.iphone-subject-sheet .subject-picker-head{background:transparent;padding:2px 14px 8px}
.iphone-subject-sheet .subject-picker-head h2{font-size:18px}
.iphone-subject-sheet .subject-picker-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px max(14px,env(safe-area-inset-left)) 18px;scrollbar-width:thin}
.iphone-subject-sheet .subject-picker-option{flex-direction:row;justify-content:flex-start;align-items:center;gap:9px;min-height:60px;padding:8px;border:1px solid #d0dfd4;border-radius:11px}
.iphone-subject-sheet .subject-picker-option img{width:34px;height:34px}
.iphone-subject-sheet .subject-picker-option>span{font-size:14px;text-align:left;line-height:1.35}
.iphone-subject-sheet .subject-picker-option[aria-pressed=true]{padding:8px;border:1px solid #529e32;box-shadow:inset 0 0 0 1px #529e32;background:#d8f3cd}

/* Reuse the grade/category filters in a phone sheet with an explicit Done step. */
.filter-drawer.iphone-filter-sheet{pointer-events:auto}
.iphone-filter-sheet::backdrop{background:#183c3d55}
.filter-drawer.iphone-filter-sheet .browse-sidebar{inset:auto 0 0;width:100%;max-width:none;height:min(85dvh,760px);max-height:calc(100dvh - 12px);border:1px solid #bdd3c5;border-bottom:0;border-radius:22px 22px 0 0;background:var(--paper);padding:0 0 env(safe-area-inset-bottom,0px);box-shadow:0 -10px 45px #183c3d22}
.iphone-filter-head{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:2px 14px 8px;border-bottom:1px solid var(--line)}
.iphone-filter-head h2{font-family:Andika,Arial,sans-serif;font-size:18px;letter-spacing:0;margin:0}
.iphone-filter-head>button{min-width:44px;min-height:44px;font-size:26px;border:0;border-radius:8px;background:transparent}
.iphone-filter-subject{padding:12px 16px 0;flex-shrink:0}
.iphone-filter-subject p{font-size:12px;color:var(--muted);margin:8px 0 0}
.iphone-filter-sheet .sidebar-panel{padding:6px 16px 16px}
.iphone-filter-sheet .subject-grade-options button{min-height:44px;font-size:14px}
.iphone-filter-sheet .filter-disclosure>summary{font-size:16px}
.iphone-filter-footer{flex-shrink:0;border-top:1px solid var(--line);padding:10px 16px;background:#fffefa}
.iphone-filter-footer .button{width:100%;min-height:48px;font-size:15px;border-radius:10px}
.iphone-filter-open.filter-drawer-open #main{margin-left:0}
.iphone-filter-open.filter-drawer-open #app>footer{padding-left:5%}
@media(max-width:359px){.iphone-subject-trigger,.iphone-filter-trigger{gap:5px;padding:6px 8px;font-size:13px}.iphone-filter-trigger svg{display:none}.iphone-subject-sheet .subject-picker-option{gap:6px;padding:7px}.iphone-subject-sheet .subject-picker-option[aria-pressed=true]{padding:7px}.iphone-subject-sheet .subject-picker-option>span{font-size:13px}}
@media(max-height:500px){.iphone-filter-subject{padding-top:6px}.iphone-filter-subject p{display:none}.iphone-filter-footer{padding-top:6px;padding-bottom:6px}}
