* { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(145deg, #fff7ed, #fdf2f8, #ecfeff);
  color: #111827;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: 18px;
  padding: 13px 16px;
  background: #ff8a00;
  color: white;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
button:active { transform: scale(.98); }
input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 2px solid #f3f4f6;
  border-radius: 18px;
  padding: 13px;
  margin: 6px 0;
  background: #fff;
  outline: none;
}
textarea { min-height: 82px; resize: vertical; }
h1 { margin: 0; font-size: clamp(28px, 7vw, 38px); }
h2 { margin: 0 0 12px; font-size: clamp(20px, 5vw, 26px); }
h3 { margin: 18px 0 8px; }
.login { min-height: 100svh; display: grid; place-items: center; padding: 18px; }
.login-card {
  width: 100%; max-width: 420px; background: rgba(255,255,255,.9);
  border-radius: 32px; padding: 28px; box-shadow: 0 20px 60px #0002; text-align: center;
}
.logo { width: 88px; height: 88px; margin: 0 auto 12px; display: block; }
.subtitle, .small { color: #6b7280; }
.small { font-size: 12px; }
.app { width: 100%; max-width: 760px; margin: auto; padding: 14px; padding-bottom: 34px; }
.topbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.brand img { width: 52px; height: 52px; flex: 0 0 auto; }
.brand h1 { white-space: nowrap; }
.month-card, .panel {
  width: 100%; background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-radius: 28px; padding: 15px; box-shadow: 0 18px 45px #0001; margin-top: 14px;
}
.month-card { animation: pageFlip .25s ease; }
@keyframes pageFlip { from { transform: translateY(8px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.month-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-head h2 { margin: 0; text-align: center; text-transform: capitalize; font-size: clamp(18px, 5vw, 24px); }
.month-head button { background: #7c3aed; font-size: 22px; padding: 8px 16px; border-radius: 16px; }
.week, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week div { text-align: center; font-weight: 800; color: #6b7280; padding: 10px 0 6px; font-size: 12px; }
.day {
  min-width: 0; min-height: 58px; background: #fff7ed; border-radius: 17px; padding: 7px;
  cursor: pointer; border: 2px solid transparent; transition: .15s; overflow: hidden;
}
.day b { font-size: 13px; }
.day.today { background: #dcfce7; border-color: #22c55e; }
.day.selected { background: #fce7f3; border-color: #fb7185; }
.badges { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 5px; }
.mini-emoji { font-size: 13px; line-height: 1; }
.tools-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: rgba(255,255,255,.7); border-radius: 22px; padding: 8px; box-shadow: 0 10px 30px #0000000f;
}
.tools-bar button { padding: 11px 8px; border-radius: 16px; font-size: 18px; background: #fff; color: #111827; box-shadow: inset 0 0 0 1px #f3f4f6; }
.stats-compact { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.stats-compact div {
  background: rgba(255,255,255,.9); border-radius: 20px; padding: 12px 8px; text-align: center;
  box-shadow: 0 10px 25px #0000000f; min-width: 0;
}
.stats-compact b { display: block; font-size: clamp(16px, 4vw, 22px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-compact span { display: block; font-size: 11px; color: #64748b; font-weight: 700; margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.full { grid-column: 1 / -1; }
.picker-button {
  background: white; color: #111827; text-align: left; border: 2px solid #f3f4f6; display: flex;
  justify-content: space-between; align-items: center; gap: 12px; padding: 13px;
}
.picker-button span { color: #64748b; font-weight: 800; flex: 0 0 auto; }
.picker-button b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chips { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 0 0 3px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 7px 9px; background: #fff7ed; border-radius: 999px; font-weight: 800; font-size: 12px; }
.chip button { padding: 0; width: 18px; height: 18px; border-radius: 999px; background: #ef4444; font-size: 12px; }
.switch-line { display: flex; align-items: center; gap: 8px; background: #f8fafc; border-radius: 16px; padding: 10px 12px; font-weight: 700; font-size: 13px; }
.switch-line input { width: auto; margin: 0; }
.event { padding: 13px; border-radius: 18px; margin: 8px 0; background: #f8fafc; border-left: 7px solid #ff8a00; cursor: pointer; }
.event b { display: block; overflow-wrap: anywhere; }
.chat-box { background: #f9fafb; padding: 10px; border-radius: 18px; max-height: 220px; overflow: auto; }
.msg { background: white; padding: 9px; border-radius: 14px; margin-bottom: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button { flex: 1 1 90px; }
.queue-inline { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 8px 0 12px; }
.queue-inline::-webkit-scrollbar { display: none; }
.queue-inline span { flex: 0 0 auto; background: #f8fafc; border-radius: 999px; padding: 7px 9px; font-size: 12px; color: #475569; }
.green { background: #22c55e; }
.pink { background: #fb7185; }
.blue { background: #0ea5e9; }
.purple { background: #7c3aed; }
.red { background: #ef4444; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(17,24,39,.35); display: flex; align-items: flex-end;
  padding: 10px; overscroll-behavior: contain;
}
.bottom-sheet {
  width: 100%; max-width: 720px; max-height: 82svh; overflow: auto; margin: 0 auto; background: #fff;
  border-radius: 28px 28px 22px 22px; padding: 14px; box-shadow: 0 -20px 60px #0003;
}
.sheet-handle { width: 52px; height: 5px; border-radius: 999px; background: #e5e7eb; margin: 0 auto 10px; }
.bottom-sheet h3 { margin: 6px 0 2px; }
.reminder-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin: 12px 0; }
.reminder-option {
  background: #f8fafc; color: #111827; border-radius: 15px; padding: 11px 8px; font-size: 13px; box-shadow: inset 0 0 0 1px #eef2f7;
}
.reminder-option.active { background: #ff8a00; color: white; box-shadow: none; }
.custom-reminder { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; align-items: center; }
.custom-reminder input, .custom-reminder select { margin: 0; }
.custom-reminder button { padding: 12px 10px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; position: sticky; bottom: 0; background: white; padding-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; background: #111827; color: white; padding: 12px 16px; border-radius: 999px; z-index: 99; transition: .2s; font-weight: 800; max-width: calc(100vw - 30px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 520px) {
  .app { padding: 10px; }
  .topbar { align-items: flex-start; }
  .brand img { width: 46px; height: 46px; }
  .topbar .pink { padding: 11px 13px; }
  .month-card, .panel { border-radius: 24px; padding: 12px; }
  .form-grid { grid-template-columns: 1fr; gap: 5px; }
  .week, .grid { gap: 4px; }
  .week div { font-size: 10px; }
  .day { min-height: 50px; border-radius: 13px; padding: 5px; }
  .mini-emoji { font-size: 11px; }
  .stats-compact { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
  .stats-compact div { padding: 9px 4px; border-radius: 16px; }
  .stats-compact span { font-size: 10px; }
  .reminder-options { grid-template-columns: 1fr; }
  .custom-reminder { grid-template-columns: 1fr 1fr; }
  .custom-reminder button { grid-column: 1 / -1; }
}


.login-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.login-actions button,
.login-actions input {
  width: 100%;
}

.login-actions .purple {
  background: #7c3aed;
}

