* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: sans-serif;
    font-size: 14px;
    background: #fff;
    color: #333;
    padding: 20px;
}

h1 {
    font-size: 18px;
    margin-bottom: 16px;
}

table {
    border-collapse: collapse;
    width: 100%;
    max-width: 700px;
}

th,
td {
    border: 1px solid #ccc;
    padding: 8px 12px;
    vertical-align: middle;
}

th {
    background: #f0f0f0;
    text-align: left;
    white-space: nowrap;
    width: 220px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="url"],
textarea,
select {
    border: 1px solid #aaa;
    padding: 4px 6px;
    font-size: 14px;
    border-radius: 2px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"] {
    width: 240px;
}

textarea {
    width: 100%;
    height: 80px;
    resize: vertical;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-range input[type="date"] {
    width: 160px;
}

.time-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-range input[type="time"] {
    width: 120px;
}

.default-btn {
    margin-right: 4px;
    padding: 4px 10px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.default-btn:hover {
    background: #357abd;
}

.venue-wrap {
    display: flex;
    align-items: center;
}

.venue-wrap input[type="text"] {
    width: 200px;
}

.file-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-note {
    font-size: 12px;
    color: #555;
}

.preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.preview-area img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.submit-wrap {
    margin-top: 16px;
    max-width: 700px;
    text-align: left;
}

.submit-btn {
    padding: 8px 32px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.submit-btn:hover {
    background: #357abd;
}

input[type="checkbox"] {
    margin-right: 6px;
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 600px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.search-area {
    position: relative;
}

#search-input {
    width: 100%;
    padding: 8px;
    font-size: 16px;
}

#suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

#suggestions-list li {
    padding: 8px 12px;
    cursor: pointer;
}

#suggestions-list li:hover {
    background: #f0f0f0;
}

#map {
    width: 100%;
    height: 400px;
    border-radius: 4px;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

#selected-place-name {
    flex: 1;
    font-size: 14px;
    color: #555;
}

.error-message {
    color: red;
}

#imagePreview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#imagePreview div {
    position: relative;
    display: inline-block;
}

#imagePreview button {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(128, 128, 128, 0.4);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 15%;
    width: 20px;
    height: 20px;
    font-size: 12px;
}

#imagePreview button:hover {
    background: rgba(128, 128, 128, 1);
}

.required::after {
    content: " *";
    color: red;
    vertical-align: middle;
}

.link-button {
    background: none;
    border: none;
    color: blue;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.link-button:hover {
    color: darkblue;
}

dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 12px;
    border: none;
    padding: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

dialog button {
    align-self: flex-end;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1rem;
    padding: 0.5em 1em;
}

/* =====================
   スマホ対応 (600px以下)
   ===================== */
@media (max-width: 600px) {
    body {
        padding: 12px;
        font-size: 13px;
    }

    h1 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    /* テーブルをブロック表示に切り替え */
    table,
    tbody,
    tr {
        display: block;
        width: 100%;
    }

    tr {
        border: 1px solid #ccc;
        border-radius: 4px;
        margin-bottom: 8px;
        overflow: hidden;
    }

    th,
    td {
        display: block;
        width: 100%;
        border: none;
        padding: 6px 10px;
        white-space: normal;
        vertical-align: top;
    }

    th {
        background: #e8e8e8;
        border-bottom: 1px solid #ccc;
        font-size: 12px;
        color: #555;
    }

    /* テキスト入力を幅いっぱいに */
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="tel"] {
        width: 100%;
    }

    select {
        width: 100%;
    }

    /* 日付・時間の横並びは維持しつつ折り返し許可 */
    .date-range,
    .time-range {
        flex-wrap: wrap;
    }

    .date-range input[type="date"] {
        width: 100%;
        max-width: 180px;
    }

    .time-range input[type="time"] {
        width: 130px;
    }

    /* 会場入力 */
    .venue-wrap {
        flex-wrap: wrap;
        gap: 6px;
    }

    .venue-wrap input[type="text"] {
        width: 100%;
    }

    /* マップモーダル */
    #map {
        height: 280px;
    }

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

    /* 送信ボタン */
    .submit-wrap {
        margin-top: 12px;
    }

    .submit-btn {
        width: 100%;
        padding: 12px;
        font-size: 15px;
        border-radius: 4px;
    }

    /* dialogのスマホ対応 */
    dialog {
        width: 90vw;
        max-width: 360px;
    }
}
