:root {
      --bg: #ffffff;
      --surface: #ffffff;
      --surface-soft: #f4f4f4;
      --surface-card: #efefef;

      --line: #d8dce2;
      --line-strong: #c7ccd4;

      --text: #111111;
      --muted: #7a828d;

      --brand-blue: #00a0df;
      --brand-blue-dark: #00239c;
      --brand-blue-soft: rgba(0, 160, 223, 0.12);

      --brand-red: #ff4438;
      --shadow-card: 0 8px 22px rgba(0,0,0,0.05);

      --panel-width: 560px;
    }

    * {
      box-sizing: border-box;
      min-width: 0;
    }

    html, body {
      margin: 0;
      padding: 0;
      background: var(--bg);
      color: var(--text);
      font-family: Avenir, "Avenir Next", "Helvetica Neue", Arial, sans-serif;
      
    }

    body {
      min-height: 100vh;
      /* overflow-anchor: none; */
    }

   

    button, input {
      font: inherit;
    }

    .app {
      width: 100%;
      max-width: none;
      margin: 0 auto;
      padding: 18px 16px 40px;
      background: #fff;
    }

    .page-title {
      margin: 0 0 16px;
      font-size: 27px;
      line-height: 1.05;
      font-weight: 900;
      letter-spacing: -0.03em;
      color: #000;
      padding-bottom: 17px !important;
    }

    .top-area {
      display: grid;
      /* gap: 14px; */
      margin-bottom: 20px;
      position: sticky;
      top: 0;
      z-index: 1050;
      background: #fff;
      
    }
    .guide-shell{
      container-type: inline-size;
    }
    .top-area>.toolbar{
      margin-bottom: 10px;
    }

    .toolbar,
    .categories-bar {
      border: 1px solid #eceef1;
      background: #fff;
      padding: 12px;
    }

    .toolbar {
      display: grid;
      grid-template-columns: minmax(0, 230px) auto minmax(260px, 320px);
      gap: 10px;
      align-items: center;
    }

    .date-picker-wrap {
      position: relative;
      min-width: 0;
    }

    .date-btn {
      width: 100%;
      min-height: 48px;
      border: 1px solid var(--brand-blue-dark);
      background: #fff;
      padding: 0 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      cursor: pointer;
      transition: .18s ease;
      text-align: left;
    }

    .date-btn:hover {
      background: #fafcff;
    }

    .date-btn-left {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .date-icon-badge {
      width: 38px;
      height: 38px;
      border: 1px solid var(--brand-blue-dark);
      background: #fff;
      display: grid;
      place-items: center;
      flex-shrink: 0;
    }

    .date-icon-badge svg {
      width: 22px;
      height: 22px;
    }

    .date-text {
      min-width: 0;
    }

    .date-label {
      display: block;
      font-size: 10px;
      line-height: 1;
      margin-bottom: 5px;
      text-transform: uppercase;
      color: var(--muted);
      font-weight: 900;
      letter-spacing: 0.06em;
    }

    .date-value {
      display: block;
      font-size: 15px;
      font-weight: 900;
      color: #111;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .date-arrow {
      color: var(--brand-blue-dark);
      font-size: 12px;
      font-weight: 900;
      flex-shrink: 0;
    }

    .date-input {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      pointer-events: none;
    }

    .mode-row {
      display: flex;
      align-items: stretch;
      gap: 8px;
      flex-wrap: wrap;
    }

    .mode-btn {
      min-height: 48px;
      padding: 0 20px;
      border: 1px solid var(--line);
      background: #fff;
      color: #111;
      font-size: 14px;
      font-weight: 900;
      cursor: pointer;
      transition: .18s ease;
      white-space: nowrap;
    }

    .mode-btn:hover {
      border-color: var(--brand-blue-dark);
    }

    .mode-btn.active {
      border-color: var(--brand-blue-dark);
      background: var(--brand-blue-dark);
      color: #fff;
    }

    .search-wrap {
      position: relative;
      min-width: 0;
    }

    .search-icon {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--brand-blue-dark);
      font-size: 13px;
      font-weight: 900;
      pointer-events: none;
    }

    .search-input {
      width: 100%;
      min-height: 48px;
      border: 1px solid var(--line);
      background: #fff;
      padding: 0 14px 0 40px;
      font-size: 14px;
      font-weight: 800;
      color: #111;
      outline: none;
    }

    .search-input:focus {
      border-color: var(--brand-blue-dark);
    }

    .search-input::placeholder {
      color: #7f8995;
      font-weight: 700;
    }

    .categories-title {
      margin: 0 0 10px;
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--brand-blue-dark);
    }

    .genre-scroll {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      overflow-y: hidden;
      padding-bottom: 2px;
      scrollbar-width: thin;
      scrollbar-color: #9b9b9b #d9d9d9;
    }

    .genre-scroll::-webkit-scrollbar {
      height: 8px;
    }

    .genre-scroll::-webkit-scrollbar-track {
      background: #d9d9d9;
    }

    .genre-scroll::-webkit-scrollbar-thumb {
      background: #9b9b9b;
    }

    .genre-chip {
      min-height: 38px;
      padding: 0 14px;
      border: 1px solid var(--line);
      background: #fff;
      color: #111;
      font-size: 14px;
      font-weight: 900;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
      transition: .18s ease;
    }

    .genre-chip:hover {
      border-color: var(--brand-blue-dark);
    }

    .genre-chip.active {
      border-color: var(--brand-blue-dark);
      background: var(--brand-blue-dark);
      color: #fff;
    }

    .channel-list {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
      background: #fff;
      min-height: 487px;
     
    }
    .channel-list.dabar{
      min-height: 194px;
    }
    .channel-card {
      border: 1px solid #eceef1;
      background: #fff;
      min-height: 0px;
      display: flex;
      flex-direction: column;
      transition: transform .18s ease, box-shadow .18s ease;
    }

    .channel-card:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-card);
    }

    .channel-top {
      padding: 16px;
      border-bottom: 1px solid #eceef1;
      background: #fff;
      min-height: 86px;
      display: flex;
      align-items: center;
    }

    .channel-info {
      display: flex;
      align-items: center;
      gap: 14px;
      width: 100%;
    }

    .logo-btn,
    .panel-logo {
      width: 46px;
      height: 46px;
      border: 1px solid var(--line);
      background: #fff;
      display: grid;
      place-items: center;
      overflow: hidden;
      /* cursor: pointer; */
      padding: 5px;
      flex-shrink: 0;
      transition: .18s ease;
    }

    .logo-btn:hover {
      border-color: var(--brand-blue);
      transform: scale(1.04);
    }
    .channel-top:hover {
      border-color: var(--brand-blue);
      transform: scale(1.01);
      cursor: pointer;
      border: 1px solid var(--brand-blue);
    }
    .logo-btn img,
    .panel-logo img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .channel-meta strong {
      display: block;
      font-size: 15px;
      line-height: 1.25;
      color: #111;
      font-weight: 900;
      margin-bottom: 4px;
    }

    .channel-meta span {
      display: block;
      font-size: 12px;
      color: var(--muted);
      line-height: 1.2;
    }

    .program-list {
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      flex: 1;
      background: #fff;
    }

    .program-visible,
    .hidden-programs,
    .past-programs {
      display: grid;
      gap: 10px;
    }

    .program-box {
      display: grid;
      gap: 0;
    }

    .program-item {
      border: 1px solid #bfc7d1;
      background: var(--surface-card);
      min-height: 74px;
      padding: 10px 12px;
      cursor: pointer;
      transition: .18s ease;
    }

    .program-item:hover {
      border-color: var(--brand-blue);
    }

    .program-item.is-now {
      border-color: var(--brand-blue);
      background: var(--brand-blue-soft);
    }

    .program-time {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      font-size: 12px;
      font-weight: 900;
      color: #111;
      line-height: 1.1;
      margin-bottom: 6px;
    }

    .program-title {
      font-size: 15px;
      line-height: 1.2;
      font-weight: 900;
      color: #000;
      margin-bottom: 4px;
    }

    .program-category {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.2;
    }

    .now-text {
      color: var(--brand-blue);
      font-size: 10px;
      font-weight: 900;
      letter-spacing: 0.04em;
    }

    .program-description {
      display: none;
      border: 1px solid var(--brand-blue);
      border-top: none;
      background: #fff;
      padding: 10px 12px;
      font-size: 12px;
      line-height: 1.45;
      color: #3f4852;
    }

    .program-box.open .program-description {
      display: block;
    }

    /* .hidden-programs {
      margin-top: 10px;
    } */

    .more-slot {
      margin-top: auto;
      display: flex;
      align-items: center;
      min-height: 20px;
    }

    .more-btn {
      border: none;
      background: transparent;
      color: #000;
      font-size: 13px;
      font-weight: 900;
      cursor: pointer;
      padding: 0;
    }

    .empty-state {
      padding: 24px 18px;
      border: 1px dashed var(--line-strong);
      background: #fff;
      color: var(--muted);
      font-size: 15px;
    }

    .empty-state.nochannels{
      max-height: 76px;
    }

    .panel-day-section:has(.panel-program-list:empty) {
      display: none;
    }

    .panel-day-btn.empty-date{
      display:none;
    }
    .overlay {
      position: fixed;
      inset: 0;
      background: rgba(10, 14, 20, 0.22);
      backdrop-filter: blur(2px);
      opacity: 0;
      pointer-events: none;
      transition: .22s ease;
      z-index: 1500;
    }

    .overlay.show {
      opacity: 1;
      pointer-events: auto;
    }

    .channel-panel {
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      width: var(--panel-width);
      max-width: 100vw;
      background: #fff;
      border-left: 1px solid var(--line);
      box-shadow: -18px 0 40px rgba(0,0,0,0.10);
      transform: translateX(110%);
      transition: transform .28s ease;
      z-index: 3000;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .channel-panel.open {
      transform: translateX(0);
    }

    .panel-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 16px;
      border-bottom: 1px solid var(--line);
      background: #fff;
      flex-shrink: 0;
    }

    .panel-brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .panel-brand strong {
      display: block;
      font-size: 16px;
      font-weight: 900;
      color: #111;
      line-height: 1.2;
    }

    .panel-sub {
      margin-top: 4px;
      font-size: 13px;
      color: var(--muted);
    }

    .close-btn {
      width: 40px;
      height: 40px;
      border: 1px solid var(--line);
      background: #fff;
      color: #000;
      font-weight: 900;
      cursor: pointer;
    }

    .panel-days {
      border-bottom: 1px solid var(--line);
      background: #fff;
      padding: 10px 12px;
      display: flex;
      gap: 8px;
      overflow-x: auto;
      flex-shrink: 0;
    }

    .panel-day-btn {
      min-width: 86px;
      min-height: 46px;
      padding: 8px 10px;
      border: 1px solid var(--line);
      background: #fff;
      color: #111;
      font-size: 13px;
      font-weight: 900;
      line-height: 1.2;
      cursor: pointer;
      transition: .18s ease;
      flex-shrink: 0;
    }

    .panel-day-btn:hover {
      border-color: var(--brand-blue);
    }

    .panel-day-btn.active {
      border-color: var(--brand-blue-dark);
      background: var(--brand-blue-dark);
      color: #fff;
    }

    .panel-scroll {
      flex: 1;
      overflow-y: auto;
      padding: 0 16px 20px;
      background: #fff;
      scroll-behavior: smooth;
    }

    .panel-day-section {
      padding-top: 18px;
      scroll-margin-top: 12px;
    }

    .panel-day-heading {
      position: sticky;
      top: 0;
      z-index: 2;
      background: #fff;
      padding: 12px 0 10px;
      border-bottom: 1px solid var(--line);
      margin-bottom: 10px;
    }

    .panel-day-heading strong {
      display: block;
      font-size: 18px;
      font-weight: 900;
      color: #111;
      line-height: 1.1;
    }

    .panel-day-heading span {
      display: block;
      margin-top: 4px;
      font-size: 12px;
      color: var(--brand-blue-dark);
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .panel-program-list {
      display: grid;
      gap: 8px;
    }

    .panel-program-box {
      display: grid;
      gap: 0;
    }

    .panel-program-item {
      position: relative;
      border: 1px solid #bfc7d1;
      background: var(--surface-card);
      padding: 12px;
      cursor: pointer;
      transition: .18s ease;
    }

    .panel-program-item:hover {
      border-color: var(--brand-blue);
    }

    .panel-program-item.is-now {
      border-color: var(--brand-blue);
      background: var(--brand-blue-soft);
    }

    

    .panel-program-time {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 6px;
      font-size: 12px;
      font-weight: 900;
      color: #111;
      padding-right: 24px;
    }

    .panel-program-title {
      margin-bottom: 4px;
      font-size: 14px;
      font-weight: 900;
      line-height: 1.25;
      color: #000;
    }

    .panel-program-category {
      font-size: 12px;
      color: var(--muted);
      font-weight: 700;
    }

    .panel-program-desc {
      display: none;
      border: 1px solid var(--brand-blue);
      border-top: none;
      background: #fff;
      padding: 10px 12px;
      font-size: 12px;
      line-height: 1.45;
      color: #3f4852;
    }

    .panel-program-box.open .panel-program-desc {
      display: block;
    }
    @media (min-width: 576px) {
    .container.container-custom {
        max-width: 100%;
    }
}

    @media (min-width: 768px) {
      .channel-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    @media (min-width: 1100px) {
      .channel-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
    }
     @container (min-width: 1600px) {
      .channel-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
      }
    } 

    @media (max-width: 1040px) {
      .toolbar {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 640px) {
      .container.container-custom{
        padding-left:0;
        padding-right:0;      
      }
      .container-fluid.container-fluid-custom{
        padding-left:0;
        padding-right:0;
      }
      .container-fluid.container-fluid-custom > .container.container-custom >.row{
        margin-left:0;
        margin-right:0;
      }
       .container-fluid.container-fluid-custom > .container.container-custom >.row > .col-12{
        padding-left:0;
        padding-right:0;
      }
      .app {
        padding: 14px 12px 26px;
      }
      body {
        /* overflow-anchor: none; */
       }
      .page-title {
        font-size: 22px;
      }

      .program-item{
          /* border-color: red; */
      }
      .mode-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .mode-btn {
        min-height: 40px;
        padding: 0 8px;
        font-size: 12px;
      }

      .genre-chip {
        min-height: 34px;
        padding: 0 12px;
        font-size: 12px;
      }

      .channel-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
      }

      .channel-card {
        min-height: 0px;
      }

      .channel-top {
        min-height: 74px;
        padding: 10px;
      }

      .program-list {
        padding: 10px;
        gap: 8px;
        
      }

      .program-item {
        min-height: 66px;
        padding: 8px 10px;
      
      }

      .logo-btn,
      .panel-logo {
        width: 42px;
        height: 42px;
        padding: 4px;
      }

      .channel-meta strong {
        font-size: 12px;
      }

      .channel-meta span {
        font-size: 10px;
      }

      .program-time {
        font-size: 10px;
      }

      .program-title {
        font-size: 12px;
      }

      .program-category {
        font-size: 10px;
      }

      .channel-panel {
        width: 100vw;
      }

      .panel-days {
        padding: 8px 10px;
      }

      .panel-day-btn {
        min-width: 78px;
        min-height: 44px;
        font-size: 12px;
      }

      .panel-scroll {
        padding: 0 12px 18px;
      }
    }

    @media (max-width: 380px) {
      .channel-list {
        grid-template-columns: 1fr;
      }

      .mode-row {
        grid-template-columns: 1fr;
      }
      .top-area{
        position: static;
      }
    }