/**
 * Styling rules for the interactive accessibility map UI.
 *
 * This file defines the layout, responsive behavior, map container styling,
 * sidebar controls, ranking tables, legend appearance, tooltip styling, and
 * other visual elements used by the FastAPI + Leaflet frontend.
 */


      html, body {
        margin: 0;
        font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
        background: #f8fafc;
      }

      body {
        overflow-y: auto;
      }

      .app {
        min-height: 100vh;
        display: grid;
        grid-template-columns: 360px 1fr;
        align-items: start;
      }

      .sidebar {
        border-right: 1px solid #e5e7eb;
        padding: 14px;
        overflow: auto;
        position: sticky;
        top: 0;
        height: 100vh;
        box-sizing: border-box;
        background: white;
      }

      .content {
        padding: 24px;
        box-sizing: border-box;
      }

      .map-panel {
          display: flex;
          flex-direction: column;
          min-height: 100vh;
          margin-bottom: 24px;
          padding-top: 20px;
        }

      .map-header {
        margin: 0 auto 14px auto;
        text-align: center;
        max-width: 900px;
      }

      .map-header h1 {
        margin: 0 0 4px 0;
        font-size: 20px;
        font-weight: 700;
        color: #111827;
      }

      .map-header p {
        margin: 0;
        font-size: 14px;
        color: #6b7280;
      }

      .map {
        height: calc(100vh - 110px);
        min-height: 600px;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        background: white;
      }

      .notes-box {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        padding: 20px 22px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
        max-width: 1100px;
        margin-bottom: 24px;
      }

      .notes-box h2 {
        margin: 0 0 10px 0;
        font-size: 20px;
        color: #111827;
      }

      .notes-box p {
        margin: 0 0 10px 0;
        line-height: 1.5;
        color: #374151;
      }

      .notes-box p:last-child {
        margin-bottom: 0;
      }

      h2 {
        margin: 0 0 10px 0;
        font-size: 18px;
      }

      .field {
        margin: 10px 0;
      }

      label {
        display: block;
        font-size: 12px;
        color: #374151;
        margin-bottom: 6px;
      }

      select {
        width: 100%;
        padding: 8px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: white;
      }

      input[type="range"] {
        width: 100%;
      }

      .row {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
      }

      .muted {
        color: #6b7280;
        font-size: 12px;
      }

      .leaflet-interactive:focus {
        outline: none !important;
      }

      .leaflet-interactive {
        outline: none !important;
      }

      .tt-tooltip {
        background: white;
        border: 1px solid #d1d5db;
        border-radius: 10px;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
        padding: 10px 12px;
        color: #111827;
      }
      .page-corner-image {
          position: fixed;
          top: 0;
          right: 0;
          height: 22px;
          width: auto;
          object-fit: contain;
          z-index: 9999;
          display: block;
        }
        .legend {
          background: white;
          padding: 10px 12px;
          border-radius: 10px;
          box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
          line-height: 1.35;
          color: #111827;
          font-size: 12px;
        }

        .legend-title {
          font-weight: 600;
          margin-bottom: 6px;
        }

        .legend-item {
          display: flex;
          align-items: center;
          gap: 8px;
          margin: 3px 0;
        }

        .legend-swatch {
          width: 14px;
          height: 14px;
          border-radius: 3px;
          border: 1px solid rgba(0,0,0,0.15);
          flex: 0 0 14px;
        }

        .sidebar-footer {
          margin-top: 20px;
          padding-top: 16px;
          border-top: 1px solid #e5e7eb;
        }

        .sidebar-footer {
          margin-top: auto;
          padding-top: 16px;
          border-top: 1px solid #e5e7eb;
          display: flex;
          flex-direction: column;
          align-items: center;
          text-align: center;
        }

        .github-link {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          gap: 8px;
        }

        .github-link:hover {
          text-decoration: underline;
        }

        .github-link svg {
          width: 20px;
          height: 20px;
          fill: currentColor;
          flex: 0 0 20px;
        }

        .daytype-tabs,
        .dataset-tabs {
          display: grid;
          gap: 8px;
        }

        .daytype-tabs {
          grid-template-columns: repeat(3, 1fr);
        }

        .dataset-tabs {
          grid-template-columns: repeat(2, 1fr);
        }

        .daytype-tab,
        .dataset-tab {
          appearance: none;
          border: 1px solid #d1d5db;
          background: #ffffff;
          color: #111827;
          border-radius: 12px;
          padding: 10px 12px;
          min-height: 42px;
          width: 100%;
          box-sizing: border-box;
          font: inherit;
          font-size: 13px;
          font-weight: 600;
          text-align: center;
          cursor: pointer;
          transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
        }

        .daytype-tab:hover,
        .dataset-tab:hover {
          background: #f8fafc;
          border-color: #9ca3af;
        }

        .daytype-tab.active,
        .dataset-tab.active {
          background: #111827;
          color: #ffffff;
          border-color: #111827;
          box-shadow: 0 4px 12px rgba(17, 24, 39, 0.16);
        }

        .ranking-grid {
          display: grid;
          grid-template-columns: 1fr;
          gap: 10px;
          margin-top: 14px;
        }

        .ranking-card {
          background: #f8fafc;
          border: 1px solid #e5e7eb;
          border-radius: 12px;
          padding: 10px 12px;
        }

        .ranking-title {
          font-size: 13px;
          font-weight: 700;
          color: #111827;
          margin-bottom: 8px;
        }

        .ranking-table {
          width: 100%;
          border-collapse: collapse;
          font-size: 12px;
        }

        .ranking-table th,
        .ranking-table td {
          padding: 6px 0;
          text-align: left;
          border-bottom: 1px solid #e5e7eb;
          vertical-align: top;
        }

        .ranking-table th:last-child,
        .ranking-table td:last-child {
          text-align: right;
        }

        .ranking-table tr:last-child td {
          border-bottom: none;
        }

        .ranking-empty {
          font-size: 12px;
          color: #6b7280;
        }

        @media (min-width: 901px) {
          .ranking-grid {
            grid-template-columns: 1fr;
          }
        }

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

          .map-panel {
            order: 2;
            min-height: auto;
            margin-bottom: 0;
            padding: 16px 16px 0 16px;
          }

        .sidebar {
          border-right: none;
          border-bottom: 1px solid #e5e7eb;
          padding: 14px;
          overflow: visible;
          position: static;
          top: auto;
          height: auto;
          box-sizing: border-box;
          background: white;
          display: flex;
          flex-direction: column;
        }

          .content {
            padding: 16px;
          }

          .map-header {
            margin: 0 0 12px 0;
            max-width: none;
          }

          .map-header h1 {
            font-size: 18px;
          }

          .map-header p {
            font-size: 13px;
          }

          .map {
            height: 56vh;
            min-height: 360px;
            border-radius: 12px;
            width: 100%;
          }

          .notes-box {
            margin-top: 16px;
            margin-bottom: 0;
            padding: 16px;
            border-radius: 12px;
          }

          .page-corner-image {
            position: absolute;
            top: 0;
            right: 0;
            height: 18px;
          }

          .leaflet-tile {
          width: 257px !important;
          height: 257px !important;
          margin-left: -0.5px !important;
          margin-top: -0.5px !important;
          border: none !important;
          outline: none !important;
        }

        .leaflet-container img,
        .leaflet-tile {
          max-width: none !important;
          max-height: none !important;
        }
        }
