/* The original desktop layout remains in effect above 1000px. */
.tategasi-nav-label { display: none; }
@media screen and (max-width: 1000px) {
    html { scroll-padding-top: 16px; }
    #wrapper { width: 100%; padding: 0 16px; box-sizing: border-box; font-family: Meiryo, sans-serif; line-height: 1.7; overflow-wrap: anywhere; }
    #wrapper *, #wrapper *::before, #wrapper *::after { box-sizing: border-box; }
    #wrapper img { max-width: 100%; height: auto; }
    #title_waku { width: 100%; height: auto; padding: 20px 0; display: flex; align-items: center; gap: 20px; }
    #title1, #title2 { float: none; height: auto; min-width: 0; }
    #title1 { width: 60%; font-size: 13px; }
    #title2 { width: 40%; }
    #title2 a { display: inline-block; }
    .pic_waku1 { width: 100%; height: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
    .pic_waku2 { width: auto; height: auto; float: none; }
    .pic_waku2 img { width: 100%; border-radius: 10px; }
    .tategasi-gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
    .tategasi-gallery .pic_waku1 { display: contents; }
    .tategasi-gallery > .c { display: none; }
    #introduction { width: 100%; height: auto; padding: 16px; font-size: 15px; line-height: 1.8; margin: 16px 0; }
    nav ul { width: 100%; height: auto; display: flex; align-items: stretch; }
    nav li { width: 33.333%; float: none; }
    nav li a { display: flex; align-items: center; justify-content: center; min-height: 56px; height: 100%; padding: 8px; border: 1px solid #21ac4a; background: linear-gradient(#40d16a, #10a83d); color: #fff; text-decoration: none; font-size: 14px; line-height: 1.4; text-align: center; }
    #wrapper nav li a:has(.tategasi-nav-label) img { display: none; }
    nav .tategasi-nav-label { display: block; }
    #info1, #info2, #contact1, #contact2, #co_profile1, #co_profile2, #kotani, footer, #foot3,
    #privacy1, #privacy2, #privacy2 h1, #category, #detail1, #detail2, #detail3, #contact3 { width: 100%; height: auto; }
    #info1 { margin-top: 32px; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
    #info1 > img { float: none; }
    #info1 ul { float: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; border: 0; }
    #info1 ul li { float: none; padding: 0; border: 0; }
    #info1 ul li a { display: block; padding: 6px 14px; background: #edf9f0; border-radius: 6px; }
    #info2 table, #info2 tbody { display: block; width: 100%; }
    #info2 table tr.line1 { display: none; }
    #info2 table tr.line2, #info2 table tr.line3 { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 8px 12px; height: auto; line-height: 1.7; padding: 16px; margin-bottom: 12px; border: 1px solid #cbe3d1; border-radius: 8px; text-align: left; }
    #info2 table tr td { width: auto; min-width: 0; padding: 0; }
    #info2 .add, #info2 .station { grid-column: 1 / -1; }
    #info2 .add { font-weight: bold; }
    #info2 .land { align-self: center; }
    #info2 .detail { text-align: right; align-self: end; }
    #info2 .detail a { display: inline-flex; align-items: center; min-height: 44px; }
    #info2 .detail img { width: 120px; }
    #info2 .add::before, #info2 .station::before, #info2 .land::before { display: block; color: #526557; font-size: 12px; font-weight: normal; }
    #info2 .add::before { content: '住所'; }
    #info2 .station::before { content: '最寄り駅'; }
    #info2 .land::before { content: '土地面積'; }
    #info2 table tr.bukkengaiyousyo { display: block; height: auto; line-height: 1.7; text-align: right; margin: -12px 0 12px; padding: 4px 12px 8px; }
    #info2 .bukkengaiyousyo td { display: block; }
    #info2 .bukkengaiyousyo a { display: inline-block; padding: 8px 0; }
    #contact1, #co_profile1 { margin-top: 40px; margin-bottom: 12px; text-align: left; }
    #contact0 { line-height: 1.8; }
    #contact0 a { display: block; margin-bottom: 10px; }
    #contact2 table, #contact2 tbody, #contact2 table tr, #contact2 table tr td { display: block; width: 100%; height: auto; line-height: 1.7; }
    #contact2 table tr { padding: 14px; text-align: left; }
    #contact2 table tr td { padding: 0; }
    #contact2 .form1, #contact2 .form4 { font-weight: bold; margin-bottom: 6px; }
    #contact2 .form2 { color: #222; }
    #contact2 .form3 { color: #555; font-size: 13px; margin-top: 4px; }
    #contact2 .form3:empty { display: none; }
    #wrapper .wpcf7-form-control-wrap { display: block; width: 100%; }
    #wrapper .wpcf7 input:not([type='submit']):not([type='checkbox']):not([type='radio']):not([type='hidden']),
    #wrapper .wpcf7 textarea, #wrapper .wpcf7 select { width: 100%; max-width: 100%; min-width: 0; padding: 10px; height: auto; min-height: 44px; font-size: 16px; color: #222; background: #fff; border: 1px solid #a8b5aa; border-radius: 4px; }
    #wrapper .wpcf7 textarea { min-height: 160px; margin-top: 0; }
    #wrapper .wpcf7 input[type='submit'] { max-width: 100%; cursor: pointer; }
    #wrapper .send_button { background-size: contain; background-position: center; }
    #wrapper .wpcf7-response-output { margin: 16px 0; padding: 12px; }
    #co_profile2 table, #co_profile2 tbody, #detail2 table, #detail2 tbody { display: block; width: 100%; }
    #co_profile2 table tr, #detail2 table tr { display: grid; grid-template-columns: minmax(80px, 28%) minmax(0, 1fr); height: auto; line-height: 1.8; }
    #co_profile2 table tr td, #detail2 table tr td { width: auto; min-width: 0; height: auto; padding: 12px 10px; line-height: 1.8; }
    #co_profile2 table tr td:first-child, #detail2 table tr td:first-child { font-weight: bold; }
    #category { line-height: 1.8; margin: 16px 0; text-align: left; }
    #detail1 { padding: 14px; line-height: 1.6; font-size: 22px; }
    #detail3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 24px 0; }
    #detail3 > .c { display: none; }
    #madori, #map { float: none; width: 100%; height: 300px; min-width: 0; }
    #madori { display: flex; align-items: center; justify-content: center; }
    #madori img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
    #map > iframe { width: 100% !important; height: 100% !important; max-width: 100% !important; display: block; border: 0; }
    #kotani { margin: 40px 0 20px; }
    footer { margin-top: 24px; }
    #foot1 { display: none; }
    #foot2 { float: none; margin-left: auto; }
    #foot3 { float: none; padding: 20px 12px; line-height: 1.8; font-size: 11px; }
    #privacy1 { margin-top: 20px; }
    #privacy2 { padding: 0; margin-top: 20px; }
    #privacy2 h1 { margin-top: 28px; line-height: 1.8; }
    #send { width: 100%; margin: 60px auto; }
    .pagetop { right: 16px; bottom: 20px; z-index: 10; }
    a, input, textarea, select, button { touch-action: manipulation; }
}
@media screen and (max-width: 600px) {
    #wrapper { padding: 0 12px; }
    #title_waku { display: block; padding: 16px 0; }
    #title1, #title2 { width: 100%; text-align: center; }
    #title1 { font-size: 12px; }
    #title1 img { max-height: 74px; width: auto; }
    #title2 { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; }
    #title2 > a, #title2 .fone_mo { width: 50%; min-width: 0; }
    #title2 .fone_pc { display: none; }
    #title2 .fone_mo { display: block; }
    #title2 .fone_mo a { display: block; }
    .pic_waku1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #introduction { font-size: 14px; }
    #info1 > img { max-width: 85%; }
    #detail3 { grid-template-columns: minmax(0, 1fr); }
    #madori { height: auto; min-height: 180px; max-height: 360px; }
    #madori img { max-height: 358px; }
    #map { height: 280px; }
    #detail1 { font-size: 20px; }
}
