/* style.css — вид «бумаги» адаптирован из daily-old/www/css/style.css.
   Белая полупрозрачная бумага, синяя тень, скруглённый верх, заголовок #6E93FF,
   оверлей дел с чекбоксами поверх прозрачной textarea. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #fff;
  font-family: "Helvetica Neue", "Roboto", "Segoe UI", sans-serif;
  color: #4A4A4A;
  -webkit-text-size-adjust: 100%;
}

#app, .scroller { height: 100%; }

/* Горизонтальная лента листочков */
.scroller {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.scroller::-webkit-scrollbar { display: none; }

:root { --day-width: 100vw; }
@media (orientation: landscape) {
  :root { --day-width: clamp(300px, 32vw, 460px); }
}

.paper-container {
  flex: 0 0 var(--day-width);
  width: var(--day-width);
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 18px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.day-wrapper {
  background: rgba(255, 255, 255, 0.78);
  min-height: 100%;
  padding: 18px;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 3px 8px 0 rgba(110, 147, 255, 0.79);
  overflow: hidden;
}

.day-title {
  font-size: 26px;
  color: #6E93FF;
  margin: 6px 0 22px;
  font-weight: 400;
  line-height: 1.15;
}
.day-title .rel { color: #9bb2ff; font-size: 0.7em; }

.day-content.loading { min-height: 200px; }

/* День-строки: подъём (верх) и сон (низ), кликабельные -> модалка сна */
.day-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 15px;
  color: #6E93FF;
  -webkit-tap-highlight-color: transparent;
}
.day-line:active { opacity: 0.6; }
.day-line.wake { border-bottom: 1px solid rgba(110, 147, 255, 0.12); margin-bottom: 6px; }
.day-line.sleep { margin-top: 18px; border-top: 1px solid rgba(110, 147, 255, 0.12); color: #7a86b8; }
.day-line.sleep.off { opacity: 0.5; }
.day-line-label { color: #999; }
.day-line-value { font-weight: 500; }
.day-line-sub { color: #999; font-size: 0.92em; }
.day-line-bell { font-size: 0.9em; }
.play-btn {
  margin-left: auto;
  background: rgba(110, 147, 255, 0.12);
  color: #6E93FF;
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
}
.play-btn:active { opacity: 0.6; }

/* Модалка настройки сна */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(0, 0, 30, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 16px; padding: 22px;
  width: 100%; max-width: 380px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.modal-title { font-size: 20px; color: #6E93FF; margin-bottom: 16px; font-weight: 500; }
.modal-sub { color: #b8b8b8; font-size: 0.72em; font-weight: 400; }
.modal-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; color: #555; font-size: 15px; gap: 10px; }
.modal-row input[type="time"], .modal-row .num { border: 1px solid #cfd9ff; border-radius: 6px; padding: 4px 6px; font-size: 15px; background: #fff; color: #4A4A4A; }
.modal-row .num { width: 3.6em; }
.modal-row.toggle input { width: 20px; height: 20px; accent-color: #6E93FF; }
.modal-bedtime { background: #f3f6ff; border-radius: 10px; padding: 12px; margin: 8px 0; text-align: center; color: #4A4A4A; }
.modal-bedtime b { color: #6E93FF; font-size: 1.15em; }
.modal-note { font-size: 12px; color: #999; margin-top: 4px; }
.modal-ok { width: 100%; margin-top: 14px; background: #6E93FF; color: #fff; border: none; border-radius: 10px; padding: 12px; font-size: 16px; cursor: pointer; }
.modal-ok:active { opacity: 0.85; }

/* Настройки */
.settings { margin: 0 0 14px; }
.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: #999;
  font-size: 14px;
  border-bottom: 1px solid rgba(110, 147, 255, 0.15);
}
.settings-item input[type="time"] { font-size: 14px; border: 1px solid #cfd9ff; border-radius: 4px; padding: 2px 4px; background: #fff; color: #4A4A4A; }
.settings-item .num { width: 3em; font-size: 14px; border: 1px solid #cfd9ff; border-radius: 4px; padding: 2px 4px; }
.settings-item.toggle-row input { width: 18px; height: 18px; accent-color: #6E93FF; }

.alarm-info {
  background-color: #0000FF;
  color: #fff;
  margin: 0 -8px 14px;
  padding: 12px 18px;
  border-radius: 6px;
}

.tasks-count { margin: 10px 0; font-size: 14px; color: #666; }
.tasks-count i { color: gray; font-size: 0.9em; }

/* Редактор дел: оверлей с чекбоксами под прозрачной textarea */
.textarea_wrapper { position: relative; min-height: 8em; margin: 8px 0 16px; }
.textarea_wrapper .pre,
.textarea_wrapper textarea {
  font-size: 1.15em;
  line-height: 1.4em;
  font-family: "Helvetica Neue", "Roboto", "Segoe UI", sans-serif;
  box-sizing: border-box;
  width: 100%;
  padding: 0.4em 0;
  border: none;
  border-right: solid 2px lightblue;
}
.textarea_wrapper .pre {
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(0, 0, 0, 0);
  min-height: 8em;
}
.textarea_wrapper textarea {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  resize: none;
  overflow: hidden;
  background-color: transparent;
  color: #4A4A4A;
  outline: none;
}
.textarea_wrapper textarea::placeholder { color: #D0D0D0; font-size: 0.85em; }

.tasks-checkbox {
  display: inline-block;
  width: 0.45em; height: 0.45em;
  margin: 0 0.55em 0.12em -0.85em;
  vertical-align: middle;
  background-color: rgba(0, 0, 0, 0.22);
  border-radius: 1px;
}
.tasks-checkbox.done { background-color: #6E93FF; }

/* Оверлей будильника */
.alarm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.alarm-card {
  background-color: #0000FF;
  color: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
}
.alarm-card h2 { margin: 0 0 12px; font-weight: 500; font-size: 22px; }
.alarm-card p { margin: 0 0 20px; opacity: 0.92; line-height: 1.4; }
.alarm-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.alarm-card button {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
}
.alarm-card button.alarm-primary { background: #fff; color: #0000FF; border-color: #fff; font-weight: 600; width: 100%; }
.alarm-card button:active { transform: translateY(1px); }

/* Чип логина (поверх ленты, правый верх) */
.login-chip {
  position: fixed;
  top: 8px; right: 10px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.login-chip .login-email { color: #6E93FF; background: rgba(255,255,255,0.85); padding: 3px 8px; border-radius: 10px; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-chip .login-btn { font-size: 12px; border: 1px solid #cfd9ff; background: #fff; color: #6E93FF; border-radius: 10px; padding: 3px 8px; cursor: pointer; }

/* Режим конфликта синхронизации */
.conflict-banner {
  background: #fff3cd;
  border: 1px solid #ffe69c;
  color: #7a5b00;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}
.conflict-banner code { background: rgba(0,0,0,0.08); padding: 0 3px; border-radius: 3px; font-size: 0.95em; }
.conflict-area {
  width: 100%;
  min-height: 50vh;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid #ffd24d;
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  background: #fffdf5;
  color: #4A4A4A;
}

/* Кросс-ссылки */
.crosslinks { margin: 14px 0; font-size: 14px; color: #555; }
.crosslink { margin: 6px 0 6px 8px; }
.crosslink a { color: #6E93FF; text-decoration: none; }
