﻿/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */

/* ===== 1400px AND DOWN (95% font scale) ===== */
@media (max-width: 1400px) {
  :root {
    font-size: 95%;
  }

  .dashboard {
    grid-template-columns: 230px minmax(0, 1fr) 330px;
  }
}

/* ===== 1100px AND DOWN (90% font scale) ===== */
@media (max-width: 1100px) {
  :root {
    font-size: 90%;
  }

  .dashboard {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .right-column {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .status-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ===== 860px AND DOWN (85% font scale) ===== */
@media (max-width: 860px) {
  :root {
    font-size: 85%;
  }

  .sidebar {
    display: block;
    margin: 0;
    padding: 0;
  }

  .sidebar-lower {
    display: none;
  }

  .nav-item.no-highlight {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 3px;
    padding: 0px 3px;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-item {
    flex-direction: column;
    text-align: center;
    padding: 3px;
    gap: 2px;
    flex: 0 0 80px;
    width: 80px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.2);
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .nav-copy {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .nav-copy .ja {
    display: block;
    font-size: 0.45rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    word-break: break-word;
    overflow: hidden;
    max-height: 2.2em;
  }

  .nav-copy .en {
    display: none;
  }

  .dashboard {
    grid-template-columns: 1fr;
    padding: 0px 3px 3px 3px;
    gap: 3px;
    margin-top: 0;
  }

  .core-header {
    flex-direction: column;
  }

  .header-main {
    flex-direction: column;
    text-align: center;
    gap: 0px;
    padding: 2px 6px;
    border-bottom: 1px solid rgba(91, 255, 169, 0.15);
    margin-bottom: 0;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-name .ja {
    font-size: 1.4rem;
    line-height: 1.1;
  }

  .brand-name .en {
    font-size: 0.45rem;
    line-height: 0.7;
    margin-top: 0px;
  }

  .header-admin {
    display: none;
  }

  .utility-nav {
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.75rem;
  }

  .header-system {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 4px 6px;
    font-size: 0.75rem;
  }

  .system-item {
    flex-wrap: wrap;
  }

  .system-label {
    min-width: auto;
  }

  .header-message {
    display: none;
  }

  .logout-link {
    display: none;
  }

  .system-info {
    display: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .news-item {
    grid-template-columns: 82px 1fr 100px;
  }

  .right-column {
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}

/* ===== 640px AND DOWN (80% font scale) ===== */
@media (max-width: 640px) {
  :root {
    font-size: 80%;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-name .ja {
    font-size: 1.2rem;
    line-height: 1.0;
  }

  .brand-name .en {
    font-size: 0.4rem;
    line-height: 0.6;
    margin-top: 0px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding: 6px 12px;
    font-size: .7rem;
  }

  .footer-links {
    gap: 10px;
  }
}