body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Roboto", sans-serif;
  background: #f5f7fb;
  color: #1f2933;
}

/* Видимый статус до инициализации JS (важно для WebView MAX / ngrok на телефоне) */
.boot-banner {
  margin: 0;
  padding: 10px 16px;
  font-size: 14px;
  text-align: center;
  background: #e0e7ff;
  color: #312e81;
  border-bottom: 1px solid #c7d2fe;
}

.boot-banner.boot-banner--error {
  background: #fee2e2;
  color: #991b1b;
  border-bottom-color: #fecaca;
}

.boot-banner.boot-banner--ok {
  display: none;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: #6b7280;
}

.title {
  margin: 4px 0;
  font-size: 26px;
}

.subtitle {
  margin: 4px 0 12px;
  color: #4b5563;
}

.muted {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(20, 40, 80, 0.04);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.icon-btn {
  background: #eef2ff;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.secondary {
  background: #eef2ff;
  border: 1px solid #d8dcff;
  color: #3040f0;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.day {
  position: relative;
  padding: 12px 0;
  text-align: center;
  background: #f8fafc;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.day.today {
  border-color: #d8dcff;
}

.day.selected {
  background: #3040f0;
  color: white;
}

.dot {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
}

.event-card .title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.badge {
  background: #eef2ff;
  color: #3040f0;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.time {
  color: #4b5563;
  margin-top: 4px;
  font-size: 14px;
}

.event-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

.btn-delete,
.btn-reschedule {
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}

.btn-delete:hover {
  background: #fee2e2;
  border-color: #ef4444;
}

.btn-reschedule:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

.empty {
  color: #6b7280;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 15px;
  resize: none;
  outline: none;
  background: #f9fafb;
  box-sizing: border-box;
}

button#createBtn {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  background: #3040f0;
  color: white;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.15s;
}

button#createBtn:active {
  transform: translateY(1px);
}

.result {
  margin-top: 12px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 12px;
  font-size: 15px;
  white-space: pre-wrap;
  line-height: 1.4;
}

.hidden {
  display: none;
}

.loader {
  margin: 20px auto;
  border: 6px solid #ddd;
  border-top-color: #3040f0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hint {
  color: #6b7280;
  font-size: 12px;
  margin-top: 8px;
}

/* Hide "Сегодня" section (task 3) */
#todaySection {
  display: none;
}

/* Past events styling (task 5) */
.event--past {
  opacity: 0.5;
  background: #f3f4f6 !important;
  border-color: #d1d5db !important;
}

.event--past .title-row span:first-child {
  color: #6b7280;
}

.event--past .time {
  color: #9ca3af;
}

.past-label {
  display: inline-block;
  background: #e5e7eb;
  color: #6b7280;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 8px;
  font-weight: 500;
}

/* Schedule Management Styles */
.primary {
  background: #3040f0;
  border: none;
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

.primary:active {
  transform: translateY(1px);
}

.danger {
  background: #ef4444;
  border: none;
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

.danger:active {
  transform: translateY(1px);
}

.input-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #f9fafb;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.input-field:focus {
  border-color: #3040f0;
  background: white;
}

.wizard-step {
  margin-bottom: 20px;
}

.wizard-step h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.wizard-navigation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.wizard-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.wizard-actions button {
  flex: 1;
  min-width: 120px;
}

.priorities-list,
.availability-list,
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.priority-item,
.availability-item,
.task-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.priority-number {
  background: #3040f0;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.priority-value {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.availability-item {
  flex-direction: column;
  align-items: stretch;
}

.availability-item label {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-inputs input[type="time"] {
  flex: 1;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

.task-item {
  flex-wrap: wrap;
}

.task-item .input-field {
  margin-bottom: 0;
}

.weekdays-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  width: 100%;
}

.weekday-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 12px;
}

.weekday-checkbox input[type="checkbox"] {
  cursor: pointer;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.schedule-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.schedule-item-header {
  margin-bottom: 12px;
}

.schedule-item-header h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
}

.schedule-meta {
  font-size: 12px;
  color: #6b7280;
}

.schedule-item-actions {
  display: flex;
  gap: 8px;
}

.schedule-item-actions button {
  flex: 1;
}

.schedule-preview {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule-day-preview {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}

.schedule-day-preview h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 700;
  color: #3040f0;
}

.schedule-block-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.time-badge {
  background: #eef2ff;
  color: #3040f0;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.category-badge {
  background: #f3f4f6;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  text-transform: uppercase;
  margin-left: auto;
}

.error {
  color: #ef4444;
  padding: 12px;
  background: #fee2e2;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

/* Burger Menu Styles */
.burger-menu-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.burger-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #1f2937;
  border-radius: 2px;
  transition: 0.3s;
}

.burger-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: fadeIn 0.2s;
}

.burger-menu-overlay.active {
  display: block;
}

.burger-menu-drawer {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 80%;
  height: 100%;
  background: white;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s;
  overflow-y: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.burger-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.burger-menu-header h3 {
  margin: 0;
  font-size: 18px;
}

.burger-menu-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.burger-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #1f2937;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}

.burger-menu-item:hover,
.burger-menu-item:active {
  background: #f3f4f6;
}

.burger-menu-item span:first-child {
  font-size: 18px;
}

/* Schedule Items List Editor */
.schedule-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.schedule-item-editor {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-item-editor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.schedule-item-editor-row.full-width {
  grid-template-columns: 1fr;
}

.schedule-item-editor-row .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schedule-item-editor label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  display: block;
}

.schedule-item-editor select,
.schedule-item-editor input[type="time"],
.schedule-item-editor input[type="number"] {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  width: 100%;
  box-sizing: border-box;
}

.schedule-item-editor-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.schedule-editor-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.schedule-editor-actions button {
  flex: 1;
}

/* Reschedule Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: white;
  border-radius: 16px;
  padding: 24px;
  width: 320px;
  max-width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.2s;
}

.modal-dialog h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

.modal-dialog .form-group {
  margin-bottom: 14px;
}

.modal-dialog .form-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 4px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
}

/* Loading overlay */
.loading-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 10;
  justify-content: center;
  align-items: center;
  border-radius: 16px;
}

.loading-overlay.active {
  display: flex;
}

.card {
  position: relative;
}
