


@media (max-width: 860px) {

  
  #topbar {
    height: 48px;
    padding: 0 14px;
    gap: 10px;
    
    border-bottom: 1px solid var(--c-gold-soft);
  }
  #topbar .title { font-size: 15px; }

  
  .hb-burger {
    width: 44px; height: 44px;
    margin-left: -8px;      
    flex-shrink: 0;
  }

  
  #content {
    padding: 16px 14px 12px;
  }

  
  .card {
    padding: 16px 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 15, 15, 0.04);
  }
  .card.glass-alert { padding: 12px 14px; }

  
  .mod-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }
  .mod-header h2 { font-size: 19px; }
  .mod-sub {
    font-size: 11.5px;
    letter-spacing: 0.02em;   
    line-height: 1.7;
  }
  .mod-tools {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .mod-tools > .btn { flex: 1 1 45%; white-space: nowrap; }
  .mod-tools > .btn-primary { flex: 1 1 100%; }
  
  .mod-tools.att-tools > .btn-primary { flex: 1 1 45%; }

  
  .dash-header {
    padding: 14px 0 12px;
    gap: 10px;
  }

  
  .dash-stats {
    grid-template-columns: repeat(3, 1fr);
    padding: 22px 0 18px;
    margin-bottom: 20px;
  }
  .dash-stat { padding: 10px 10px 10px 0; min-width: 0; }
  .dash-stat:not(:last-child) {
    border-right: 1px solid var(--c-border);
    border-bottom: none;
    padding-right: 10px;
    padding-left: 0;
  }
  .dash-stat:nth-child(2), .dash-stat:nth-child(3) { padding-left: 10px; }
  .dash-stat .stat-label {
    margin-bottom: 8px;
    font-size: 11px;
    letter-spacing: 0.12em;
    white-space: nowrap;
    overflow: hidden;              
  }
  .dash-stat .stat-label::before { font-size: 13px; }
  .dash-stat .stat-num { font-size: 44px; margin-bottom: 4px; white-space: nowrap; }
  .dash-stat .stat-num::after { width: 26px; margin-top: 8px; }
  .dash-stat .stat-suffix { font-size: 22px; }
  .dash-stat .stat-extra { font-size: 10.5px; line-height: 1.5; }

  
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2 { grid-template-columns: 1fr; gap: 10px; }

  
  .btn { min-height: 40px; padding: 9px 14px; font-size: 14px; }
  .btn-sm { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  
  .btn-mini { min-height: 40px; min-width: 44px; padding: 8px 14px; font-size: 13px; }
  
  .mod-tools .btn { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  
  .tbl td .btn-mini { min-height: 40px; min-width: 44px; padding: 6px 14px; font-size: 13px; }
  
  .sb-foot-settings { width: 44px; height: 44px; font-size: 17px; }
  
  .att-btn { min-width: 44px; min-height: 40px; font-size: 16px; }
  
  .rec-tab { min-height: 40px; }
  
  .tbl th, .tbl td { font-size: 13px; }

  
  .tbl { display: block; width: 100%; }
  .tbl tbody { display: block; }
  .tbl tr {
    margin-bottom: 10px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 2px 12px;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(15, 15, 15, 0.04);
  }
  
  .tbl td {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;   
  }
  .tbl tr td:last-child { border-bottom: none; }
  
  .tbl td[data-label]::before {
    content: attr(data-label);
    min-width: 72px;
    flex-shrink: 0;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--c-text-3);
    font-weight: 500;
  }
  
  .tbl tbody tr:hover { background: #FFFFFF; }
  .tbl tbody tr:active { background: var(--c-gold-soft); }

  
  .tbl tr { position: relative; }
  .tbl td:has(> input[type="checkbox"]) {
    position: absolute;
    top: 6px; right: 12px;
    left: auto;
    
    width: auto;
    padding: 0;
    border-bottom: none;
    min-height: 0;
  }
  
  .tbl td:has(> input[type="checkbox"])::before { display: none; }
  
  .tbl tr:has(> td:first-child input[type="checkbox"]) > td:nth-child(2) {
    padding-right: 36px;
  }

  
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select:not([type="hidden"]),
  textarea { font-size: 16px; }
  .form-row input, .form-row select, .form-row textarea,
  input.txt, select.txt, textarea.txt,
  
  .mod-tools input, .mod-tools select, .mod-tools .btn,
  .mod-tools select.txt, .mod-tools input.txt, .mod-tools textarea.txt,
  input.dpick, select.dpick, textarea.dpick { font-size: 16px; }
  
  input[type="checkbox"], input[type="radio"] {
    width: 18px; height: 18px;
    accent-color: var(--c-gold);
    vertical-align: middle;
  }

  
  #sidebar {
    width: min(78vw, 300px);
    box-shadow: 8px 0 32px rgba(15, 15, 15, 0.14);
  }
  #sidebar.open { width: min(78vw, 300px); }
  #sidebar .sb-item {
    min-height: 44px;
    font-size: 16px;              
  }
  #sidebar .sb-group-title { font-size: 10px; }
  #sidebar .sb-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }

  
  #mobile-tabbar {
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid var(--c-gold-soft);
    box-shadow: 0 -1px 14px rgba(15, 15, 15, 0.06);
  }
  #mobile-tabbar .mt-item {
    position: relative;
    min-height: 48px;
    padding: 7px 4px 5px;
    font-size: 10.5px;
    letter-spacing: 0.06em;
  }
  #mobile-tabbar .mt-item .icon { font-size: 21px; width: 21px; height: 21px; }
  #mobile-tabbar .mt-item.on { color: var(--c-gold); }
  
  #mobile-tabbar .mt-item.on::before {
    content: '';
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 22px; height: 2px;
    background: var(--c-gold);
  }
}


@media (max-width: 560px) {

  
  
  .dash-header {
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: 12px;
  }
  .dash-greeting { width: auto; }
  .dash-time-block {
    justify-self: end;
    align-self: baseline;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    padding-top: 0;
  }
  .dash-time-label { display: none; }
  .dash-time-value { font-size: 26px; }
  .dash-eyebrow { font-size: 10px; letter-spacing: 0.14em; }
  .dash-hello {
    font-size: clamp(30px, 9.5vw, 44px);
    line-height: 1.02;
  }
  .dash-hello .role-tag { font-size: 11px; margin-top: 6px; letter-spacing: 0.1em; }

  
  .dash-progress {
    padding: 14px 0;
    margin-bottom: 20px;
    gap: 10px;
  }
  .dash-progress-value { font-size: 15px; }

  
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
    padding: 18px 0 16px;
    margin-bottom: 16px;
  }
  .dash-stat { padding: 10px 0; min-width: 0; }
  
  .dash-stat:first-child {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding: 2px 0 16px;
    margin-bottom: 6px;
  }
  
  .dash-stat:nth-child(2) {
    border-right: 1px solid var(--c-border);
    border-bottom: none;
    padding: 4px 12px 4px 0;
  }
  .dash-stat:nth-child(3) {
    border-right: none;
    border-bottom: none;
    padding: 4px 0 4px 12px;
  }
  .dash-stat .stat-label {
    margin-bottom: 6px;
    font-size: 10px;
    letter-spacing: 0.12em;
    white-space: nowrap;
    overflow: hidden;
  }
  .dash-stat .stat-label::before { font-size: 12px; }
  .dash-stat .stat-num { font-size: 34px; margin-bottom: 4px; white-space: nowrap; }
  .dash-stat .stat-num::after { width: 20px; margin-top: 6px; }
  .dash-stat .stat-suffix { font-size: 18px; }
  
  .dash-stat:first-child .stat-label { font-size: 11px; margin-bottom: 8px; }
  .dash-stat:first-child .stat-num { font-size: 56px; }
  .dash-stat:first-child .stat-num::after { width: 34px; margin-top: 8px; }
  .dash-stat:first-child .stat-suffix { font-size: 26px; }
  
  .dash-stat .stat-extra {
    font-size: 10px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dash-stat:first-child .stat-extra { font-size: 11px; }

  
  .dash-quick {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 4px;
    padding: 36px 0 14px;
    margin-bottom: 18px;
  }
  .dash-quick::before { top: 6px; }
  .dash-quick-item {
    border-left: 1px solid var(--c-border);
    border-top: 1px solid var(--c-border);
    padding: 12px 6px 10px;
    gap: 3px;
  }
  
  .dash-quick-item:nth-child(3n+1) { border-left: none; padding-left: 0; }
  .dash-quick-item:nth-child(-n+3) { border-top: none; }
  .dash-quick-item .qi-icon { width: 18px; height: 18px; margin-bottom: 1px; }
  .dash-quick-item .qi-text { font-size: 13.5px; }
  .dash-quick-item .qi-num { font-size: 10px; margin-top: 1px; }

  
  .dash-notices { padding: 30px 0 36px; }

  
  .dash-notice-item { padding: 10px 0; }
  .dash-notice-item .n-title { font-size: 13.5px; }
  .dash-notice-item .n-meta { font-size: 10.5px; }

  
  .class-grid { gap: 12px; }
  .class-card-v2 .ccv-head { padding: 14px 14px 12px; gap: 12px; }
  .class-card-v2 .ccv-avatar { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; }
  .class-card-v2 .ccv-name { font-size: 15.5px; }
  .class-card-v2 .ccv-meta { font-size: 11.5px; }
  .class-card-v2 .ccv-body { padding: 10px 14px; }
  .class-card-v2 .ccv-stat { font-size: 11.5px; }
  .class-card-v2 .ccv-invite { padding: 9px 14px; }
  .class-card-v2 .ccv-actions { padding: 10px 14px; gap: 8px; }
  .class-card-v2 .ccv-actions .btn { min-width: 0; flex: 1 1 44%; }

  
  .att-btns { gap: 6px; width: 100%; }
  .att-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 44px;
    height: 48px;          
    font-size: 17px;
    border-radius: 10px;
  }
  .att-btn .icon { width: 16px; height: 16px; }
  .att-lb { font-size: 11px; letter-spacing: .02em; }

  
  .stat-card { padding: 14px 12px; }
  .stat-card .sc-value { font-size: 21px; }

  
  .section-title { font-size: 12px; letter-spacing: 0.1em; margin-bottom: 14px; padding-bottom: 10px; }

  
  .preset-grid { grid-template-columns: 1fr; gap: 12px; }

  
  .rec-tabs {
    flex-wrap: wrap;        
    margin: 2px -14px 12px;
    padding: 0 14px;
  }
  .rec-tab { padding: 10px 12px; font-size: 13px; }

  
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .quick-tile { padding: 14px 10px; }
  .quick-tile .qt-icon { width: 26px; height: 26px; font-size: 24px; margin-bottom: 4px; }
  .quick-tile .qt-label { font-size: 13px; }
  .quick-tile .qt-sub { font-size: 10.5px; }

  

  
  #login-page { padding: var(--s-5) var(--s-4); }
  #login-page .login-title { letter-spacing: 0.04em; }
}


@media (max-width: 400px) {
  #content { padding: 14px 10px 12px; }
  .card { padding: 14px 12px; }
  .dash-hello { font-size: 30px; }
  .dash-time-value { font-size: 34px; }
  
  .dash-stat:first-child .stat-num { font-size: 46px; }
  .dash-stat:not(:first-child) .stat-num { font-size: 28px; }
  .dash-stat:nth-child(2) { padding-right: 10px; }
  .dash-stat:nth-child(3) { padding-left: 10px; }
  .rec-tabs { margin-left: -10px; margin-right: -10px; padding: 0 10px; }
  
  .tbl td[data-label]::before { min-width: 60px; }
}


@media (max-width: 900px) and (max-height: 480px) and (orientation: landscape) {
  #topbar { height: 40px; }
  .dash-time-block { padding-top: 0; }
  .dash-time-value { font-size: 32px; }
  .dash-stats { padding: 12px 0; margin-bottom: 12px; }
  .dash-stat:first-child .stat-num { font-size: 38px; }
  .dash-stat:not(:first-child) .stat-num { font-size: 26px; }
}


@media (hover: none), (pointer: coarse) {
  
  #login-page #login-submit:hover { background: var(--g1); letter-spacing: 0.4em; }
  
  .btn:hover { border-color: #E0E0E0; color: #1a1a1a; }
  
  .btn-danger:hover { background: #FAF0F0; color: #B06367; border-color: #D4B5B5; }
  
  .btn-mini:hover { background: white; border-color: var(--c-border); color: var(--c-text); }
  .btn-mini.btn-danger:hover { background: white; color: var(--c-danger); border-color: #FCA5A5; }
  
  .att-btn:hover { background: white; }
  
  .dash-quick-item:hover .qi-text { color: var(--c-g2); transform: none; }
  .dash-quick-item:hover .qi-num { color: var(--c-g6); }
  .dash-quick-item:hover::before { content: none; }
  
  .dash-stat:hover { transform: none; }
  
  .tbl tbody tr:hover { background: #FFFFFF; }
}


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