* { 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: 600px; background: #ffffff; padding: 10px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); }
h1 { font-size: clamp(16px, 11px + 1.48vw, 28px); color: #1e293b; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-weight: 700; border-left: 5px solid #0284c7; padding-left: 12px; text-align: left; white-space: nowrap; margin: 0px 10px 10px 10px; letter-spacing: 0.03em; line-height: 1.2; }
h2 { font-size: clamp(13px, 8.00px + 1.56vw, 20px); color: #2c3e50; margin-top: 20px; }
.alert { padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; font-weight: bold; text-align: center; }
.alert-success { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-danger { background-color: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 12px; font-weight: bold; color: #666; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"] { width: 100%; padding: 12px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; background-color: #fafafa; }
button, .btn { display: block; width: 100%; padding: 12px 6px; line-height: 1.2; box-sizing: border-box; border: none; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; text-align: center; text-decoration: none; transition: opacity 0.2s; }
button[type="submit"] { background-color: #4caf50; color: #ffffff; box-shadow: 0 3px 6px rgba(76, 175, 80, 0.2); }
button:hover, .btn:hover { opacity: 0.85; }
.btn-danger { background-color: #ff5722; color: #ffffff; }
.btn-secondary { background-color: #e0e0e0; color: #444444; }
.btnx { margin-top: 10px; }
.cal-header { display: flex; justify-content: space-between; align-items: center; background-color: #f7f9f6; padding: 10px; border-radius: 10px; margin-bottom: 15px; }
.cal-title { text-align: center; font-size: 14px; font-weight: bold; color: #444; line-height: 1.4; }
.cal-btn { text-decoration: none; color: #ffffff; font-weight: bold; padding: 6px 12px; border: 1px solid #4caf50; border-radius: 6px; background-color: #3498db; font-size: 13px; }
.calendar-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 15px; }
.calendar-table th { padding: 8px 0; font-size: 12px; background-color: #f5f5f5; border: 1px solid #e0e0e0; text-align: center; color: #555; }
.calendar-table td { position: relative; height: 115px; border: 1px solid #e0e0e0; vertical-align: top; padding: 0; box-sizing: border-box; }
.calendar-table td.sunday { background-color: #fbe9e7; }
.calendar-table td.saturday { background-color: #e1f5fe; }
.day-num { position: absolute; top: 2px; left: 4px; font-size: 12px; font-weight: 700; z-index: 4; pointer-events: none; }
.calendar-table td.sunday .day-num { color: #d32f2f; }
.calendar-table td.saturday .day-num { color: #0288d1; }
.grid-container { display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); width: 100%; height: 100%; padding-top: 18px; box-sizing: border-box; }
.grid-cell { border-top: 1px dashed #eee; border-left: 1px dashed #eee; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; position: relative; background: #fff; transition: background 0.2s; }
.grid-container .grid-cell:nth-child(1), .grid-container .grid-cell:nth-child(2) { border-top: none; }
.grid-container .grid-cell:nth-child(1), .grid-container .grid-cell:nth-child(3) { border-left: none; }
.grid-cell.has-icon { background-color: #e8f5e9; }
.grid-cell:hover { background-color: #f5f5f5; }
.palette-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 100; align-items: center; justify-content: center; padding: 10px; }
.palette-content { background: #fff; border-radius: 12px; width: 100%; max-width: 450px; padding: 15px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.palette-title { font-size: 14px; font-weight: bold; margin-bottom: 10px; text-align: center; color: #2c3e50; }
.emoji-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-height: 250px; overflow-y: auto; padding: 5px; border: 1px solid #eee; border-radius: 6px; }
.emoji-btn { background: #f8f9fa; border: 1px solid #ddd; border-radius: 8px; font-size: 22px; padding: 6px 0; text-align: center; cursor: pointer; transition: background 0.1s; display: flex; flex-direction: column; align-items: center; }
.emoji-btn:hover { background: #e8f5e9; border-color: #4caf50; }
.emoji-btn span { font-size: 9px; color: #666; margin-top: 2px; white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.palette-close-btn { margin-top: 12px; background: #7f8c8d; color: #fff; font-size: 14px; padding: 8px; border-radius: 6px; }
.toggle-switch-area { background: #fcfcfc; border: 1px dashed #ccc; padding: 10px; border-radius: 5px; margin-top: 20px; }
#pass_toggle { -webkit-appearance: none; appearance: none; width: 40px; height: 22px; background-color: #ccc; border-radius: 11px; position: relative; cursor: pointer; outline: none; transition: background-color 0.2s; }
#pass_toggle:checked { background-color: #4caf50; }
#pass_toggle::before { content: ""; position: absolute; width: 18px; height: 18px; background-color: #ffffff; border-radius: 50%; top: 2px; left: 2px; transition: transform 0.2s; }
#pass_toggle:checked::before { transform: translateX(18px); }
.footer-actions { margin-top: 15px; border-top: 1px solid #eee; padding-top: 15px; display: flex; justify-content: space-between; gap: 2%; width: 100%; }
.footer-actions .btn, .footer-actions button { margin: 0; white-space: nowrap; }
.footer-actions form { margin: 0; width: 32%; display: inline-block; }
@media screen and (min-width: 1024px) {
  .container { max-width: 960px; padding: 20px; }
  .calendar-table td { height: 140px; }
  .grid-container { padding-top: 22px; }
  .emoji-grid { grid-template-columns: repeat(8, 1fr); max-height: 350px; }
  .form-group { margin-bottom: 15px; }
}
@media (min-width: 835px) and (max-width: 1023px) {
  .container { zoom: 1.5; max-width: 800px; padding: 15px; }
  .calendar-table td { height: 130px; }
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 744px) and (max-width: 834px) {
  .container { zoom: 1.6; max-width: 700px; padding: 12px; }
  .calendar-table td { height: 120px; }
  .emoji-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 541px) and (max-width: 743px) {
  .container { zoom: 1.5; max-width: 520px; }
  .calendar-table td { height: 110px; }
  .grid-cell { font-size: 16px; }
}
@media (min-width: 441px) and (max-width: 540px) {
  .container { padding: 8px; }
  .calendar-table td { height: 100px; }
  .grid-cell { font-size: 15px; }
  .footer-actions { gap: 4px; }
}
@media (min-width: 391px) and (max-width: 440px) {
  .calendar-table td { height: 95px; }
  .grid-container { padding-top: 16px; }
  .grid-cell { font-size: 14px; }
  .cal-btn { padding: 5px 8px; font-size: 12px; }
}
@media (min-width: 381px) and (max-width: 390px) {
  .calendar-table td { height: 90px; }
  .grid-container { padding-top: 15px; }
  .grid-cell { font-size: 14px; }
  .emoji-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 375px) and (max-width: 380px) {
  .calendar-table td { height: 85px; }
  .grid-container { padding-top: 14px; }
  .grid-cell { font-size: 13px; }
  .cal-title { font-size: 12px; }
  .emoji-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-actions { flex-direction: column; gap: 8px; }
  .footer-actions form { width: 100%; }
}
@media (max-width: 374px) {
  body { padding: 5px; }
  .calendar-table th { font-size: 10px; padding: 4px 0; }
  .calendar-table td { height: 75px; }
  .day-num { font-size: 10px; top: 1px; left: 2px; }
  .grid-container { padding-top: 12px; }
  .grid-cell { font-size: 12px; }
  .cal-header { padding: 6px; margin-bottom: 10px; }
  .cal-title { font-size: 11px; }
  .cal-btn { padding: 4px 6px; font-size: 11px; }
  .emoji-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .emoji-btn { font-size: 18px; }
  .footer-actions { flex-direction: column; gap: 8px; }
  .footer-actions form { width: 100%; }
}
