/* Dersal v10.1 — responsive mobile layer */
html { width: 100%; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body { width: 100%; min-width: 0; overflow-x: clip; }
main, section, header, footer, .container, .narrow, .panel, .sidebar { min-width: 0; }
img, svg, video, iframe, canvas { max-width: 100%; }
iframe, video { border: 0; }
button, .btn, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, .btn, .main-nav a, .side-nav a { touch-action: manipulation; }
.table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-inline: contain; scrollbar-width: thin; }
pre, code { max-width: 100%; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-bubble, .list-item, .panel, td, th { overflow-wrap: anywhere; }

@media (max-width: 1024px) {
  .container { width: min(100% - 28px, 1180px); }
  .dashboard-shell { padding-block: 34px 76px; }
  .dashboard-grid { grid-template-columns: 220px minmax(0,1fr); gap: 18px; }
  .panel { padding: 22px; }
  .store-product-grid, .tutor-grid, .group-card-grid, .content-card-grid, .institution-class-grid { gap: 16px; }
}

@media (max-width: 820px) {
  :root { --mobile-header-height: 64px; }
  body.menu-open { overflow: hidden; }
  body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 119;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(2px);
  }
  .site-header { top: 0; z-index: 120; }
  .nav-wrap { min-height: var(--mobile-header-height); gap: 12px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 30px; height: 30px; }
  .mobile-menu {
    position: relative;
    z-index: 132;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
  }
  .main-nav {
    display: flex;
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 130;
    width: min(370px, 90vw);
    height: 100dvh;
    padding: 82px 18px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    background: #fff;
    box-shadow: -24px 0 60px rgba(15,23,42,.18);
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(105%);
    transition: transform .24s ease, opacity .2s ease, visibility .2s;
  }
  .main-nav.open { opacity: 1; visibility: visible; transform: translateX(0); }
  .main-nav > a:not(.btn), .main-nav .nav-dropdown-trigger {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    justify-content: space-between;
    border-radius: 11px;
    font-size: 14px;
    text-align: left;
  }
  .main-nav > a:not(.btn):hover, .main-nav .nav-dropdown-trigger:hover { background: var(--surface-2); }
  .main-nav .btn { width: 100%; min-height: 48px; }
  .nav-cart { justify-content: flex-start !important; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-menu {
    display: none;
    position: static;
    width: 100% !important;
    max-height: none;
    margin-top: 4px;
    padding: 6px;
    overflow: visible;
    border-radius: 12px;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: grid; }
  .nav-dropdown-menu a { min-height: 48px; padding: 9px 10px; }
  .nav-dropdown-menu a span { min-width: 0; }
  .nav-dropdown-menu a strong, .nav-dropdown-menu a small { display: block; }
  .nav-dropdown-menu a small { margin-top: 2px; line-height: 1.35; }

  .global-campaign .container { width: min(100% - 20px, 1180px); gap: 12px; }
  .global-campaign span { min-width: 0; line-height: 1.35; }
  .global-campaign a { min-height: 38px; white-space: nowrap; }
  .public-support-bar { display: none; }
  .public-support-bar.has-social { display: block; padding: 2px 0; }
  .public-support-bar.has-social .container { min-height: 32px; justify-content: center; }
  .public-support-bar .public-support-contacts { display: none; }

  .dashboard-shell { padding: 26px 0 72px; }
  .dashboard-header { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .dashboard-header h1 { font-size: clamp(25px, 7vw, 31px); }
  .dashboard-header > .btn, .dashboard-header > .action-row { width: 100%; }
  .dashboard-header > .btn { justify-content: center; }
  .dashboard-grid { display: block; }
  .sidebar {
    position: sticky;
    top: var(--mobile-header-height);
    z-index: 70;
    margin-bottom: 16px;
    padding: 8px;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(33,25,89,.09);
  }
  .sidebar .user-mini { display: none; }
  .sidebar > .btn { min-height: 42px; margin-bottom: 7px; }
  .side-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a {
    flex: 0 0 auto;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    scroll-snap-align: start;
    padding-inline: 13px;
    border: 1px solid var(--border);
    background: #fff;
  }
  .side-nav a.active { border-color: rgba(91,75,255,.22); }

  .panel, .profile-card, .booking-card, .auth-card, .product-detail-card, .invoice-sheet { border-radius: 16px; }
  .panel { padding: 18px; }
  .panel-title { align-items: flex-start; flex-direction: column; margin-bottom: 16px; }
  .panel-title > .btn, .panel-title > form, .panel-title > .action-row { width: 100%; }
  .panel-title > .btn { justify-content: center; }
  .metric-grid, .stats-grid, .store-admin-metrics, .institution-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric, .stat { padding: 17px; }
  .metric strong, .stat strong { font-size: 25px; }

  .table-wrap { width: calc(100% + 36px); margin-inline: -18px; padding-inline: 18px; }
  table { min-width: 640px; }
  th, td { padding: 12px 10px; }
  .admin-table { min-width: 980px; }
  .institution-table, .group-table { min-width: 820px; }
  .table-input { width: min(180px, 55vw); }

  .form-grid, .admin-create-grid, .admin-form-grid, .admin-form-grid.two, .admin-form-grid.three,
  .institution-member-form, .group-filter-form, .filter-bar { grid-template-columns: 1fr !important; }
  .form-grid > *, .admin-create-grid > *, .institution-member-form > *, .filter-bar > * { min-width: 0; }
  .form-control, input, select, textarea { font-size: 16px; }
  input[type="file"] { max-width: 100%; }
  .form-actions, .content-view-actions, .product-buy-form, .action-row { flex-wrap: wrap; }
  .form-actions .btn { min-width: min(100%, 180px); }

  .auth-shell { display: block; min-height: calc(100dvh - var(--mobile-header-height)); }
  .auth-aside { display: none; }
  .auth-main { min-height: calc(100dvh - var(--mobile-header-height)); padding: 24px 14px 50px; align-content: start; }
  .auth-card { width: 100%; padding: 24px 18px; }
  .auth-card h2 { font-size: 27px; }
  .role-picker, .role-picker-three { grid-template-columns: 1fr; }
  .role-card { padding: 15px; }

  .profile-layout { grid-template-columns: 1fr; gap: 16px; }
  .profile-card { padding: 20px; }
  .profile-head { align-items: flex-start; }
  .profile-head h1 { font-size: 27px; }
  .booking-card { position: static; padding: 20px; }

  .list-item, .institution-assignment-row, .announcement-head { align-items: flex-start; flex-direction: column; }
  .list-item > .action-row, .institution-assignment-row > div:last-child { width: 100%; }
  .message-thread { min-height: 220px !important; }
  .message-bubble { max-width: 92%; }
  .message-bubble img { width: auto; max-width: 100% !important; height: auto; }

  .room-shell { min-height: 100dvh; padding: 8px; padding-bottom: max(8px,env(safe-area-inset-bottom)); }
  .room-top { align-items: flex-start; flex-direction: column; margin-bottom: 8px; }
  .room-top .btn { width: 100%; }
  .meeting-frame { width: 100%; height: calc(100dvh - 142px); min-height: 420px; border-radius: 10px; }

  .invoice-sheet { padding: 22px 18px; }
  .invoice-head { flex-direction: column; gap: 14px; }
  .invoice-total { font-size: 23px; }

  .flash-stack { top: calc(var(--mobile-header-height) + 10px); right: 12px; width: calc(100% - 24px); }
  .flash { padding: 13px 14px; }

  .site-footer { padding-top: 46px; }
  .footer-grid, .market-footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px 18px; }
  .footer-grid > div:first-child, .market-footer-brand { grid-column: 1 / -1; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 7px; }

  .v92-hero-grid, .v92-story-grid, .v92-institution-grid, .store-hero-grid,
  .product-hero-grid, .product-details-grid, .cart-layout, .order-view-grid,
  .store-admin-grid, .institution-management-grid, .institution-dashboard-grid { grid-template-columns: 1fr !important; }
  .v92-hero-copy h1 { font-size: clamp(38px, 10vw, 50px); letter-spacing: -2.4px; }
  .v92-hero-art { min-height: auto; padding-top: 72px; }
  .v92-hero-illustration, .v92-story-visual img { width: 100%; height: auto; }
  .v92-story:nth-of-type(even) .v92-story-visual { order: initial; }
  .v92-products-preview, .v92-story, .v92-reviews, .v92-institution-cta, .v92-final-cta { padding-block: 58px; }
  .store-product-card, .tutor-card, .group-card, .content-card { min-width: 0; }
  .store-product-grid, .tutor-grid, .group-card-grid, .content-card-grid, .institution-class-grid,
  .package-wallet-grid, .product-benefit-grid, .linked-content-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .store-filter-panel { max-width: none; }
}

@media (max-width: 560px) {
  .container, .narrow { width: min(100% - 24px, 1180px); }
  .global-campaign .container { min-height: 58px; }
  .global-campaign span { font-size: 10px; }
  .global-campaign span > strong { display: block; }
  .global-campaign a { padding-inline: 11px; font-size: 10px; }

  .section, .store-section { padding-block: 48px; }
  .page-hero { padding: 42px 0 28px; }
  .page-hero h1 { font-size: 32px; }
  .page-hero p { font-size: 14px; }

  .panel { padding: 16px; }
  .metric-grid, .stats-grid, .store-admin-metrics, .institution-metrics,
  .store-product-grid, .tutor-grid, .group-card-grid, .content-card-grid,
  .institution-class-grid, .package-wallet-grid, .product-benefit-grid,
  .linked-content-grid, .footer-grid, .market-footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div:first-child, .market-footer-brand { grid-column: auto; }
  .metric-grid { gap: 10px; }

  .dashboard-header > .action-row, .panel-title > .action-row, .form-actions, .content-view-actions { display: grid; grid-template-columns: 1fr; }
  .dashboard-header .btn, .panel-title .btn, .form-actions .btn, .content-view-actions .btn { width: 100%; }
  .action-row form { max-width: 100%; }
  .action-row form .form-control { width: 100%; min-width: 0 !important; }

  .profile-head { gap: 14px; }
  .profile-head .avatar { width: 68px; height: 68px; border-radius: 18px; font-size: 23px; }
  .profile-head h1 { font-size: 24px; }
  .profile-meta { gap: 7px 10px; }

  .store-hero-copy h1, .v92-hero-copy h1 { font-size: 36px; letter-spacing: -2px; }
  .v92-search, .store-hero-search { grid-template-columns: 42px minmax(0,1fr); }
  .v92-search button, .store-hero-search button { grid-column: 1 / -1; width: 100%; }
  .v92-hero-actions, .hero-actions { display: grid; grid-template-columns: 1fr; }
  .v92-hero-actions .btn, .hero-actions .btn { width: 100%; }
  .v92-proof { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .v92-proof span { min-width: 0; }
  .v92-story-copy h2, .v92-section-head h2, .v92-institution-grid h2, .v92-final-cta h2 { font-size: 31px; letter-spacing: -1.4px; }
  .v92-story-visual { min-height: 260px; }
  .v92-review-card { min-width: 88vw; }

  .cart-item { grid-template-columns: 64px minmax(0,1fr); gap: 12px; }
  .cart-item-quantity { grid-column: 1 / -1; }
  .order-card { grid-template-columns: 1fr; }
  .order-card > .status, .order-card-actions { grid-column: auto; }
  .order-card-actions { display: grid; grid-template-columns: 1fr; }
  .order-card-actions .btn { width: 100%; }

  .product-summary h1 { font-size: 32px; }
  .product-buy-form { display: grid; grid-template-columns: 1fr; }
  .product-buy-form .btn { width: 100%; }

  .legal-content { padding: 42px 0; }
  .legal-content h1 { font-size: 30px; }
  .install-body { padding: 20px 0; }
  .install-card { width: calc(100% - 20px); padding: 22px 16px; border-radius: 18px; }
  .install-header { align-items: flex-start; flex-direction: column; }
  .install-header h1 { font-size: 27px; }

  .meeting-frame { height: calc(100dvh - 162px); min-height: 360px; }
}

@media (max-width: 380px) {
  .container, .narrow { width: min(100% - 18px, 1180px); }
  .main-nav { width: 94vw; padding-inline: 14px; }
  .v92-hero-copy h1, .store-hero-copy h1 { font-size: 32px; }
  .global-campaign span { max-width: 205px; }
  .global-campaign a { padding-inline: 8px; }
}

@media (hover: none) {
  .btn:hover, .feature-card:hover, .store-product-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 820px){
  .readiness-hero{grid-template-columns:1fr;text-align:center;padding:20px}.readiness-ring{margin:auto}.readiness-hero>.status{justify-self:center}.readiness-actions-grid{grid-template-columns:1fr}.readiness-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.readiness-check-title{align-items:flex-start}.readiness-test-row{grid-template-columns:1fr}.readiness-test-row .btn{width:100%}
}
@media (max-width: 560px){
  .readiness-category-grid{grid-template-columns:1fr 1fr}.readiness-button-grid{grid-template-columns:1fr}.readiness-check{padding:13px}.readiness-check-title{display:grid}.readiness-ring{width:122px;height:122px}
}
