body {
    font-family: "Meiryo UI", "メイリオ", sans-serif;
    padding: 0;
    margin: 0;
}

html, body {
    height: 100%;
}
main {
    height: calc(100dvh - 50px);
}
#mapid {
    z-index: 0;
    height: 100%;
}

/* Leaflet attribution (ライセンス表示) を常に表示 */
.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.8) !important;
    z-index: 1001 !important;
    font-size: 11px !important;
    padding: 2px 5px !important;
    margin: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 768px) {
    #title, #mark {display: none;}
    .header-left, .header-right {display: none;}
    #header {
        padding: 8px 12px;
        height: 50px;
        justify-content: center;
    }
    #mapid {width: 100%;height: 100%;}
    #dialog{
        display: none;
        text-align: center;
        line-height: 50px;
        position: absolute; 
        top: 45%;
        width: 100%;
        height: 50px;
        background-color:#FFFFFF;
        opacity:0.8;
        z-index: 1;
    }
}
@media (min-width: 768px) {
    #header {
        padding: 8px 24px;
        height: 50px;
    }
    .header-center {
        margin: 0 auto;
    }
    #mapid {width: 100%;height: 100%;}
    #dialog{
        display: none;
        text-align: center;
        line-height: 50px;
        position: absolute; 
        top: 45%;
        width: 100%;
        height: 50px;
        background-color:#FFFFFF;
        opacity:0.8;
        z-index: 1;
    }
    #mark tr td {font-size: small;}
}
td { vertical-align: middle;  /* 中央揃え */}
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1000;
    height: 50px;
    box-sizing: border-box;
    gap: 16px;
    transition: box-shadow 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#title {
    height: auto;
    max-height: 40px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

#title:hover {
    transform: scale(1.02);
}

#mark {
    height: 40px;
    border-collapse: collapse;
    margin: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

#mark:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#mark tr td {
    padding: 4px 8px;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

#mark tr td[style*="background-color"] {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 4px;
    position: relative;
}

#mark tr td[style*="background-color"]::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    z-index: -1;
}

#mark tr td:not([style*="background-color"]) {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 400;
    letter-spacing: 0.3px;
    line-height: 1.4;
    padding: 0 4px;
}

.adsbygoogle {
    margin: 0 16px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* スライドバーコンテンツ */
#searchError {
    display: none;
    color: #FF0000;
    font-size: small;
}

button.link-style-btn {
    cursor: pointer;
    border: none;
    background: none;
    color: #0033cc;
    text-align: left;
}
button.link-style-btn:hover {
    text-decoration: underline;
    color: #002080;
}

.lineListName, .prefectureListName {font-size: small;}
.passengerText {text-align: right;}
.unit {font-size: small;}
#nonPublicCheckBoxLabel {font-size: small;}
.outline {font-size: small;}
.contactText {font-size: small;}

/* #contact セクションのスタイル */
#contact .contactText {
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.7;
    margin: 20px 0;
    padding: 0 20px;
    letter-spacing: 0.3px;
}

#contact .contactText a {
    color: #0074d9;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

#contact .contactText a:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
}

#contact .contactText:first-of-type {
    margin-top: 20px;
}

@media (max-width: 768px) {
    #contact .contactText {
        font-size: 13px;
        padding: 0 20px;
    }
}
.settingText {font-size: x-small;}

/* #setting セクションのスタイル */
#setting h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 16px 0;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 2px solid #0074d9;
}

#setting .settingText {
    font-size: 13px;
    color: #666;
    margin: 0 0 16px 0;
    padding: 0 20px;
    line-height: 1.6;
}

#setting > div {
    padding: 0 20px;
    margin-bottom: 4px;
}

/* ラジオボタンスタイル */
#setting input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 50%;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    margin-right: 8px;
    vertical-align: middle;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#setting input[type="radio"]:hover {
    border-color: #333;
    background-color: #f5f5f5;
}

#setting input[type="radio"]:checked {
    background-color: #ffffff;
    border-color: #333;
}

#setting input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #333;
}

#setting input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

#setting label {
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
}

#setting input[type="radio"]:checked + label {
    font-weight: 500;
}

#setting h3:nth-of-type(2) {
    margin-top: 24px;
}

#setting #nonPublicCheckBoxLabel {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
    margin: 0;
}

#setting #nonPublicCheckBox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    margin-right: 8px;
    vertical-align: middle;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#setting #nonPublicCheckBox:hover {
    border-color: #333;
    background-color: #f5f5f5;
}

#setting #nonPublicCheckBox:checked {
    background-color: #ffffff;
    border-color: #333;
}

#setting #nonPublicCheckBox:checked::after {
    content: '';
    position: absolute;
    top: 0px;
    left: 4px;
    width: 5px;
    height: 10px;
    border: solid #333;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#setting #nonPublicCheckBox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    #setting h3 {
        margin: 20px 0 12px 0;
        font-size: 15px;
    }
    
    #setting .settingText {
        font-size: 12px;
        padding: 0 20px;
    }
    
    #setting > div {
        padding: 0 20px;
    }
    
    #setting label {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    #setting #nonPublicCheckBoxLabel {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ポップアップ */
.lineName {font-size: 80%;}
.remarks {font-size: 75%;}

/* アコーディオン */
.menu__item {
  background: #5200b7;
  color: #fff;
  cursor: pointer;
  display: block;
  margin-bottom: 1px;
  position: relative;
}
.menu__item__link {
  color: #fff;
  display: block;
  padding: 1rem;
}
 
.submenu {
  background: #fff;
  display: none;
}
.submenu__item {
  border-bottom: 1px solid #5200b7;
  color: #222;
  padding: 1rem;
}

/* #main セクションのスタイル */
#main .main-content {
    padding: 20px 0;
}

#main .section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 2px solid #0074d9;
}

#main .legend-section {
    margin-bottom: 24px;
}

#main .legend-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    margin-top: 12px;
}

#main .legend-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    position: relative;
}

#main .legend-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
}

#main .legend-item:last-child::after {
    display: none;
}

#main .legend-color {
    width: 24px;
    height: 24px;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
}

#main .legend-color::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    z-index: -1;
}

#main .legend-text {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 400;
    letter-spacing: 0.3px;
}

#main .info-card {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 14px 16px;
    margin: 20px 0;
}

#main .info-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

#main .info-text i {
    color: #0074d9;
    margin-top: 2px;
    flex-shrink: 0;
}

#main .data-section {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 24px;
    padding: 16px;
}

#main .data-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

#main .data-text {
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
    color: #555;
}

#main .description-text {
    margin: 0 0 20px 0;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

/* #search セクションのスタイル */
#search h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 16px 0;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 2px solid #0074d9;
}

#search #searchText {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: #2c3e50;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

#search #searchText:focus {
    outline: none;
    border-color: #0074d9;
    box-shadow: 0 0 0 3px rgba(0, 116, 217, 0.1);
}

#search #searchStationList {
    margin-top: 16px;
}

#search #searchStationList p {
    margin: 0 0 4px 0;
}

#search button.link-style-btn {
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    color: #2c3e50;
    letter-spacing: 0.3px;
    line-height: 1.5;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

#search button.link-style-btn:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: #2c3e50;
}

#search #searchError {
    display: none;
    color: #FF0000;
    font-size: 13px;
    margin-top: 12px;
    padding: 8px 12px;
    background-color: #fff5f5;
    border-left: 3px solid #FF0000;
    border-radius: 4px;
}

/* #database セクションのスタイル */
#database #list {
    margin-top: 16px;
}

#database #list p {
    margin: 0 0 8px 0;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
    letter-spacing: 0.3px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

#database #list p:hover {
    background-color: #f8f9fa;
}

#database #list p.line-header {
    margin-top: 16px;
    margin-bottom: 12px;
    padding: 0 12px 8px 12px;
}

#database #list p.line-header:first-child {
    margin-top: 0;
}

#database #list p.line-header strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #0074d9;
}

#database #list p.station-item {
    padding-left: 24px;
}

#database #list p .lineListName {
    font-size: 13px;
    color: #666;
    margin-left: 8px;
    font-weight: 400;
}

#database #list p:not(.line-header):not(.station-item) {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px 12px;
}

@media (max-width: 768px) {
    #database #list p {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    #database #list p.line-header strong {
        font-size: 15px;
    }
}

/* #filter セクションのスタイル */
#filter {
    padding: 20px 0;
}

#filter .section.s_01 {
    margin: 0;
}

#filter .accordion_one {
    margin-bottom: 0;
    border-radius: 0;
    overflow: hidden;
    border: 1px solid #e9ecef;
    border-top: none;
    background-color: #ffffff;
    box-shadow: none;
    transition: box-shadow 0.2s ease;
}

#filter .accordion_one:first-child {
    border-top: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

#filter .accordion_one:last-child {
    border-radius: 0 0 8px 8px;
}

#filter .accordion_one:only-child {
    border-radius: 8px;
}

#filter .accordion_one:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

#filter .accordion_header {
    background-color: #ffffff !important;
    color: #333 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 14px 16px !important;
    text-align: left !important;
    border-bottom: none !important;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

#filter .accordion_header:hover {
    background-color: #f8f9fa !important;
    opacity: 1 !important;
}

#filter .accordion_header.open {
    border-bottom: 1px solid #e9ecef !important;
}

#filter .accordion_header .i_box {
    right: 16px !important;
    width: 20px !important;
    height: 20px !important;
    margin-top: -10px !important;
    border: none !important;
    border-radius: 4px;
    background-color: transparent;
    transform: rotate(0deg) !important;
}

#filter .accordion_header .i_box .one_i {
    transform: rotate(0deg) !important;
}

#filter .accordion_header .i_box .one_i:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    width: 12px;
    height: 2px;
    background-color: #0074d9;
    border-radius: 1px;
    transition: all 0.2s ease;
}

#filter .accordion_header .i_box .one_i:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    width: 12px;
    height: 2px;
    background-color: #0074d9;
    border-radius: 1px;
    transition: all 0.2s ease;
}

#filter .accordion_header.open .i_box {
    background-color: transparent;
    transform: rotate(0deg) !important;
}

#filter .accordion_header.open .i_box .one_i {
    transform: rotate(0deg) !important;
}

#filter .accordion_header.open .i_box .one_i:before {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0;
}

#filter .accordion_header.open .i_box .one_i:after {
    transform: translate(-50%, -50%) rotate(0deg);
}

#filter .accordion_inner {
    padding: 16px !important;
    background-color: #ffffff;
}

#filter .accordion_inner .box_one {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

#filter .accordion_inner p.txt_a_ac {
    margin: 0;
}

#filter #prefectureList,
#filter #lineList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

#filter .prefectureListName,
#filter .lineListName {
    font-size: 13px;
    color: #2c3e50;
    letter-spacing: 0.3px;
    display: inline-block;
    white-space: nowrap;
}

#filter .filter-selection-display {
    margin: 0 20px 16px 20px;
    padding: 0;
}

#filter .filter-selection-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

#filter .filter-selection-item {
    margin: 0 0 8px 0;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
    color: #333;
    min-height: 20px;
    position: relative;
    box-shadow: none;
    white-space: nowrap;
    overflow: hidden;
}

#filter .filter-selection-item:last-child {
    margin-bottom: 0;
}

#filter .filter-selection-item::before {
    display: none;
}

#filter .accordion_inner label {
    display: inline-block;
    white-space: nowrap;
}

#filter .accordion_inner p {
    margin: 4px 0;
    width: 100%;
}

#filter .accordion_inner p.all-checkbox-wrapper {
    width: auto;
    display: inline-block;
    margin: 8px 0;
}

#filter .accordion_inner p.all-checkbox-wrapper strong {
    display: inline;
    margin-left: 6px;
}

#filter .accordion_inner p.all-checkbox-wrapper label.all-checkbox-label {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

#filter .accordion_inner p.all-checkbox-wrapper label.all-checkbox-label input[type="checkbox"] {
    margin: 0 6px 0 0;
}

#filter #lineList .line-break {
    width: 100%;
    height: 0;
    margin: 0;
}

#filter #lineList .term-divider {
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    margin: 8px 0;
}

/* チェックボックススタイル */
#filter input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    margin: 0 6px 0 0;
    vertical-align: middle;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#filter input[type="checkbox"]:hover {
    border-color: #333;
    background-color: #f5f5f5;
}

#filter input[type="checkbox"]:checked {
    background-color: #ffffff;
    border-color: #333;
}

#filter input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 0px;
    left: 4px;
    width: 5px;
    height: 10px;
    border: solid #333;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#filter input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

#filter .passengerText {
    font-size: 14px;
    color: #2c3e50;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

#filter .passengerText:focus {
    outline: none;
    border-color: #0074d9;
    box-shadow: 0 0 0 3px rgba(0, 116, 217, 0.1);
}

#filter .unit {
    font-size: 13px;
    color: #2c3e50;
    margin: 0 8px;
}

/* スライドバーのスタイル */
#filter .slider-container {
    width: 300px !important;
    margin: 20px 0 30px 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding: 0 !important;
}

#filter .slider-container .back-bar {
    height: 12px !important;
    background-color: #e0e0e0 !important;
    border-radius: 6px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#filter .slider-container .back-bar .selected-bar {
    background-color: #333 !important;
    border-radius: 6px !important;
}

#filter .slider-container .back-bar .pointer {
    width: 22px !important;
    height: 22px !important;
    top: -5px !important;
    margin-left: -11px !important;
    border-radius: 50% !important;
    background-color: #333 !important;
    border: 3px solid #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.2s ease !important;
}

#filter .slider-container .back-bar .pointer:hover {
    transform: scale(1.15) !important;
}

#filter .slider-container .back-bar .pointer-label {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #333 !important;
    padding: 4px 8px !important;
    background-color: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
    top: -35px !important;
}

#filter .slider-container .scale {
    margin-top: 12px !important;
}

#filter .slider-container .scale {
    overflow: visible !important;
    width: 100% !important;
    position: relative !important;
    margin-top: 12px !important;
}

#filter .slider-container .scale span {
    font-size: 12px !important;
    color: #666 !important;
    font-weight: 500 !important;
    width: 1px !important;
}

#filter .slider-container .scale ins {
    white-space: nowrap !important;
    font-size: 12px !important;
    color: #666 !important;
    font-weight: 500 !important;
    transform: translateX(-50%) !important;
}

#filter .slider-container .scale ins:last-child {
    transform: translateX(-100%) !important;
}

@media (max-width: 768px) {
    #main .main-content {
        padding: 16px 0;
    }
    
    #main .legend-item {
        padding: 6px 0;
    }
    
    #main .legend-color {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }
    
    #main .legend-text {
        font-size: 13px;
    }
    
    #main .info-card {
        padding: 12px 14px;
    }
    
    #filter {
        padding: 16px 0;
    }
    
    #filter .accordion_header {
        padding: 12px 14px !important;
        font-size: 15px !important;
    }
    
    #filter .accordion_inner {
        padding: 12px !important;
    }
}