* { box-sizing: border-box; font-family: sans-serif; }
body { background-color: #f7f9fa; color: #333; margin: 0; padding: 10px; display: flex; flex-direction: column; align-items: center; }
.container { width: 100%; max-width: 500px; background: #fff; padding: 10px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
h1 { font-size: clamp(16px, 11px + 1.48vw, 28px); color: #2c3e50; text-align: center; white-space: nowrap; margin: -20px 10px 10px 10px; }
h2 { font-size: clamp(13px, 8.00px + 1.56vw, 20px); color: #2c3e50; }
.alert { padding: 10px; border-radius: 5px; margin-bottom: 15px; font-size: 0.9rem; text-align: center; }
.alert-success { background-color: #d4edda; color: #155724; }
.alert-danger { background-color: #f8d7da; color: #721c24; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: bold; margin-bottom: 5px; }
input[type="text"], input[type="email"], input[type="password"] { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 1rem; -webkit-appearance: none; }
button, .btn { display: block; width: 100%; padding: 12px; background: #3498db; color: #fff; border: none; border-radius: 5px; font-size: 1rem; cursor: pointer; text-align: center; font-weight: bold; }
button:hover { background: #076eb3; }
.btnx { margin: 10px 1px 0px 1px; }
.btn-danger .btn { background: #3498db !important; }
.btn-danger:hover { background: #076eb3; }
.footer-actions button, .footer-actions .btn, .footer-actions form button { display: block !important; width: 100% !important; padding: 12px 5px; color: #fff; border: none; border-radius: 5px; font-size: 1rem; cursor: pointer; text-align: center; font-weight: bold; box-sizing: border-box; }
.btn-secondary { background: #95a5a6; text-decoration: none; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; background: #f8f9fa; padding: 8px; border-radius: 5px; }
.cal-header a { text-decoration: none; font-size: 1.1rem; color: #3498db; font-weight: bold; padding: 5px 10px; }
.cal-title { font-size: 1rem; font-weight: 400; text-align: center; line-height: 1.4; }
.calendar-table { width: 100%; border-collapse: collapse; margin-bottom: 15px; table-layout: fixed; }
.calendar-table th, .calendar-table td { text-align: center; padding: 6px 2px; border: 1px solid #e0e0e0; position: relative; }
.calendar-table th { background: #f2f2f2; font-size: 0.8rem; }
.calendar-table td.sunday { background-color: #ffeded; }
.calendar-table td.saturday { background-color: #edf2ff; }
.cal-header .cal-btn { display: inline-block; padding: 8px 16px; background-color: #3498db; color: #ffffff; text-decoration: none; border-radius: 10px; font-weight: bold; transition: background-color 0.2s; }
.cal-header .cal-btn:hover { background-color: #076eb3; }
.calendar-table td { height: 70px; vertical-align: top; background: #fff; }
.day-num { font-size: 0.85rem; font-weight: bold; display: block; margin-top: 2px; color: #555; position: relative; z-index: 1; }
.icon-wrap { height: 35px; display: flex; justify-content: center; align-items: center; position: relative; z-index: 1; }
.kusuri-icon { width: 30px; height: 30px; object-fit: contain; display: none; }
.day-checkbox { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; z-index: 2; -webkit-tap-highlight-color: transparent; }
.day-checkbox:checked + .icon-wrap .kusuri-icon { display: block; }
.day-checkbox:checked ~ .day-num { color: #555; }
.toggle-switch-area { background: #fcfcfc; border: 1px dashed #ccc; padding: 10px; border-radius: 5px; margin-top: 20px; }
.footer-actions { margin-top: 10px; border-top: 1px solid #eee; padding-top: 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; }
.footer-actions > a, .footer-actions > button, .footer-actions > form { flex: 1 !important; min-width: 0; }
.footer-actions form { margin: 0; }
.footer-actions .btn, .footer-actions button { padding: 8px 15px; font-size: 0.85rem; width: auto; display: inline-block; }
.footer-actions a:hover { background-color: #076eb3; }

@media screen and (min-width: 1024px) {
    .container { max-width: 900px; padding: 25px; }
    h1 { font-size: 28px; margin-top: 0; }
    h2 { font-size: 22px; }
    .calendar-table td { height: 65px; }
    .day-num { font-size: 1rem; }
    .kusuri-icon { width: 30px; height: 30px; }
}
@media (min-width: 835px) and (max-width: 1023px) {
    .container { max-width: 800px; padding: 20px; }
    h1 { font-size: 26px; margin-top: 0; }
    .calendar-table td { height: 95px; }
    .kusuri-icon { width: 40px; height: 40px; }
}
@media (min-width: 744px) and (max-width: 834px) {
    .container { zoom: 1.2; max-width: 700px; padding: 15px; }
    h1 { font-size: 24px; margin-top: -10px; }
    .calendar-table td { height: 85px; }
    .kusuri-icon { width: 35px; height: 35px; }
}
@media (min-width: 541px) and (max-width: 743px) {
    .container { max-width: 600px; }
    h1 { font-size: 22px; }
    .calendar-table td { height: 75px; }
}
@media (min-width: 441px) and (max-width: 540px) {
    .container { max-width: 100%; padding: 12px; }
    .footer-actions { flex-direction: column; gap: 8px; }
    .footer-actions > a, .footer-actions > button, .footer-actions > form { width: 100% !important; }
}
@media (min-width: 375px) and (max-width: 440px) {
    body { padding: 5px; }
    .container { padding: 10px; }
    h1 { font-size: 18px; margin: 10px 5px 5px 5px; }
    .calendar-table th, .calendar-table td { padding: 4px 1px; }
    .calendar-table td { height: 65px; }
    .footer-actions { flex-direction: column; gap: 8px; }
    .footer-actions > a, .footer-actions > button, .footer-actions > form { width: 100% !important; }
}
@media (max-width: 374px) {
    body { padding: 2px; }
    .container { padding: 6px; border-radius: 5px; }
    h1 { font-size: 15px; margin: 10px 5px 5px 5px; white-space: normal; }
    h2 { font-size: 13px; }
    .cal-header a { font-size: 0.9rem; padding: 4px 6px; }
    .cal-title { font-size: 0.85rem; }
    .calendar-table th { font-size: 0.7rem; }
    .calendar-table td { height: 55px; }
    .day-num { font-size: 0.75rem; }
    .kusuri-icon { width: 22px; height: 22px; }
    .footer-actions { flex-direction: column; gap: 6px; margin-top: 15px; padding-top: 10px; }
    .footer-actions > a, .footer-actions > button, .footer-actions > form { width: 100% !important; }
    .footer-actions .btn, .footer-actions button { padding: 10px 5px; font-size: 0.8rem; }
}
