/* ================================================================
   GRAFIK GILLETTE - RESPONSIVE.CSS
   Part of modular CSS split (v3.8.0)
   ================================================================ */

@media (max-width: 700px) {
  .edit-banner {
    padding: 12px;
    gap: 10px;
  }
  .edit-banner-text {
    flex: 1 1 100%;
  }
  .edit-banner-text .ebt-hint {
    display: none; /* Ховаємо hint на мобі — місце дороге */
  }
  .edit-banner-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .edit-banner button.save {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 120px;
    order: 1;
  }
  .edit-banner-actions .ebg-group {
    order: 2;
  }
  .ebg-row-discard-year {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
  }
  .edit-banner button:not(.save):not(.icon-only) {
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .relief-popup .rp-label {
    font-size: 7px;
    letter-spacing: 0;
  }
  .relief-popup .rp-brig {
    font-size: 18px;
    padding: 2px 0;
  }
  .relief-popup .rp-info {
    font-size: 8px;
  }
  .day-cell .ot-marker {
    width: 18px;
    height: 18px;
    font-size: 10px;
    top: 2px;
    right: 2px;
  }
  .day-cell .ot-detail-popup {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    font-size: 9px;
    padding: 2px;
  }
  .day-cell .ot-detail-popup .rp-brig {
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  /* OT detail popup: full-cell-height above, so all text is visible */
  .day-cell .ot-detail-popup {
    width: 100%;
    height: 100%;
    min-height: 80px;
    padding: 4px 3px;
    font-size: 10px;
    bottom: 100%;
    top: auto;
  }
  .day-cell .ot-detail-popup .rp-brig {
    font-size: 20px;
    padding: 3px 0;
  }
  .day-cell .ot-detail-popup .rp-label {
    font-size: 9px;
  }
  .day-cell .ot-detail-popup .rp-info {
    font-size: 10px;
    line-height: 1.3;
  }
  .day-cell .ot-detail-popup .otp-time {
    font-size: 11px;
    font-weight: 700;
  }

  /* Relief popups on mobile: keep original cell-sized overlay */
  .relief-popup .rp-label {
    font-size: 8px;
    letter-spacing: 0.2px;
  }
  .relief-popup .rp-brig {
    font-size: 20px;
    padding: 2px 0;
  }
  .relief-popup .rp-info {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  /* OT detail popup: even more height for tiny screens */
  .day-cell .ot-detail-popup {
    min-height: 70px;
    padding: 3px 2px;
    font-size: 9px;
  }
  .day-cell .ot-detail-popup .rp-brig {
    font-size: 18px;
  }
  .day-cell .ot-detail-popup .rp-label {
    font-size: 8px;
  }
  .day-cell .ot-detail-popup .rp-info {
    font-size: 9px;
    line-height: 1.25;
  }

  .relief-popup .rp-label {
    font-size: 7px;
    letter-spacing: 0;
  }
  .relief-popup .rp-brig {
    font-size: 18px;
    padding: 2px 0;
  }
  .relief-popup .rp-info {
    font-size: 8px;
  }

  .day-cell .ot-marker {
    width: 20px;
    height: 20px;
    font-size: 11px;
    top: 2px;
    right: 2px;
  }
}

@media (max-width: 600px) {
  .notif-lead-btn {
    padding: 10px 8px;
    font-size: 14px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 8px;
  }
  .container {
    padding: 12px;
  }
  .top-bar h1,
  #appContextTitle {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-bar h1::before,
  .top-bar h1::after,
  #appContextTitle::before,
  #appContextTitle::after {
    content: none !important;
    display: none !important;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .day-cell {
    min-height: 55px;
    padding: 3px;
    border-radius: 6px;
  }
  .day-num {
    font-size: 15px;
  }
  .day-shift {
    font-size: 20px;
  }
  .day-shift .shift-emoji {
    font-size: 12px;
  }
  .day-header {
    font-size: 11px;
    padding: 4px 2px;
  }
  .relief-popup {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    padding: 2px;
  }
  .relief-popup.top {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
  }
  .relief-popup .rp-brig {
    font-size: 16px;
    padding: 2px 0;
  }
  .relief-popup .rp-label {
    font-size: 7px;
  }
  .relief-popup .rp-info {
    font-size: 8px;
  }
  .brigade-table {
    font-size: 11px;
    min-width: 600px;
  }
  .brigade-table th.brig-label {
    min-width: 50px;
    padding: 5px 6px;
    font-size: 13px;
  }
  .brigade-table th.date-header {
    min-width: 26px;
    padding: 3px 1px;
  }
  .brigade-table th.date-header .dh-num {
    font-size: 12px;
  }
  .brigade-table th.date-header .dh-day {
    font-size: 9px;
  }
  .brigade-table td {
    height: 32px;
    min-width: 26px;
  }
  .brigade-table td.tc {
    font-size: 12px;
  }
  .edit-palette {
    bottom: 15px;
    padding: 6px;
    gap: 4px;
  }
  .palette-btn {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }
  /* Компактний view switcher на мобільному — тільки іконки */
  .view-btn {
    padding: 10px 8px;
    min-width: 44px;
    gap: 0;
    font-size: 0 !important;
    line-height: 1;
  }
  .view-btn[data-view]::before {
    font-size: 24px !important;
    line-height: 1;
    display: inline-block;
  }
  .view-btn[data-view='dashboard']::before {
    content: '🏠';
  }
  .view-btn[data-view='month']::before {
    content: '📅';
  }
  .view-btn[data-view='table']::before {
    content: '📋';
  }
  .dash-today-card .dtc-shift {
    font-size: 32px;
  }
  .dash-stat-card .dsc-value {
    font-size: 13px;
  }
  .dash-stat-card .dsc-value small {
    font-size: 10px;
  }
  .dash-stat-card .dsc-icon {
    font-size: 22px;
    width: 38px;
    height: 38px;
  }
  .dash-stat-card {
    padding: 10px;
    gap: 8px;
  }
  .modal {
    max-height: 90vh;
  }
  .ot-quick-buttons {
    grid-template-columns: repeat(4, 1fr);
  }
  .ot-qbtn {
    padding: 8px 4px;
    font-size: 12px;
  }
  .ot-popup {
    min-width: 70px;
    max-width: 90px;
    padding: 4px 6px;
  }
  .ot-popup .otp-content {
    font-size: 11px;
  }
  .ot-popup .otp-time {
    font-size: 9px;
  }
  .ot-summary-grid {
    grid-template-columns: 1fr;
  }
  /* 7-day chips: equal columns, no horizontal scroll */
  .dash-upcoming-list {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px !important;
    overflow: hidden !important;
    justify-content: stretch;
  }
  .dash-day-chip {
    min-width: 0 !important;
    width: auto !important;
    max-width: 100%;
    padding: 4px 0 !important;
  }
}

@media (max-width: 420px) {
  .calendar-wrap {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
  }
  .calendar {
    gap: 6px;
  }
}

@media (max-height: 720px) {
  .calendar-wrap {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
  }
}

@media (max-width: 900px) {
  .year-view {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 650px) {
  .year-view {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .year-view {
    grid-template-columns: 1fr;
  }
}