/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: light;
  --bg: #f3f1ef;
  --text: #1f1f1f;
  --muted: #6f6f6f;
  --line: #e8e8e8;
  --soft: #f6f6f6;
  --accent: #2f2f2f;
  --danger: #8b3d3d;
  --radius: 12px;
  --surface: rgba(255, 255, 255, 0.5);
  --surface-strong: rgba(255, 255, 255, 0.68);
  --surface-soft: rgba(255, 255, 255, 0.38);
  --surface-border: rgba(255, 255, 255, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  background-image: var(--mood-bg, none);
  background-attachment: fixed;
  background-size: cover;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--mood-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: none;
  background-size: auto;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

a {
  transition: color 160ms ease;
}

::selection {
  background: #f1f1f1;
}

a {
  transition: color 160ms ease;
}

::selection {
  background: #f1f1f1;
}

button {
  font-family: inherit;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 120px;
  position: relative;
  z-index: 2;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.eyebrow:hover {
  color: var(--text);
}

.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
}

.lp {
  padding-top: 48px;
}

.lp-hero {
  display: grid;
  gap: 16px;
  margin-bottom: 36px;
}

.lp-title {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lp-lead {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
}

.lp-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.lp-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.lp-cards {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.lp-card {
  padding: 20px;
}

.lp-quiet {
  padding: 24px;
}

.lp-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  display: grid;
  gap: 8px;
}

.lp-actions--bottom {
  margin-top: 16px;
}

.page-title__emoji {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  font-size: 30px;
  line-height: 1;
  min-width: 30px;
  justify-content: center;
}

.page-title__emoji:empty {
  visibility: hidden;
}

.emoji-badge {
  margin-right: 8px;
  font-size: 30px;
}

.section-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 500;
}

.section-title__emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-size: 20px;
  line-height: 1;
}

.section-title__emoji:empty {
  display: none;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-caption {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.card {
  padding: 32px 28px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), rgba(255, 255, 255, 0.32));
  border: 1px solid var(--surface-border);
  box-shadow: 0 10px 28px rgba(18, 16, 14, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 24px;
}

.card--airy {
  padding: 36px 28px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.note-text {
  margin: 0;
  font-size: 15px;
}

.text-link {
  font-size: 14px;
  color: var(--muted);
}

.text-link:hover {
  color: var(--text);
}

.text-link:focus-visible {
  outline: 2px solid #d9d9d9;
  outline-offset: 2px;
  border-radius: 6px;
}

.text-link.danger {
  color: var(--danger);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.secondary-button:hover {
  background: #f4f4f4;
}

.secondary-button:focus-visible {
  outline: 2px solid #d9d9d9;
  outline-offset: 2px;
}

.secondary-button--dark {
  background: #111;
  border-color: #111;
  color: #fff;
}

.secondary-button--dark:hover {
  background: #1c1c1c;
}

.primary-button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}

.primary-button:hover {
  opacity: 0.9;
}

.primary-button:focus-visible {
  outline: 2px solid #d9d9d9;
  outline-offset: 2px;
}

.text-input,
.text-area {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--surface-strong);
  font-family: inherit;
  transition: border-color 160ms ease;
}

.text-input--select {
  padding-right: 24px;
  width: auto;
  min-width: 180px;
  max-width: 280px;
}

.text-input--soft,
.text-area--soft {
  background: var(--surface-soft);
  border-color: transparent;
}

.mood-picker {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.mood-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mood-label {
  font-size: 12px;
  color: var(--muted);
}

.mood-clear {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.mood-button {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--surface-strong);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.mood-button.is-active {
  border-color: #d6d6d6;
  background: #f1f1f1;
}

.mood-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.emoji-picker {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.emoji-label {
  font-size: 12px;
  color: var(--muted);
}

.emoji-clear {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.emoji-picker__current {
  display: flex;
  align-items: center;
  gap: 10px;
}

.emoji-current {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--surface-strong);
  font-size: 22px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.emoji-current__label {
  font-size: 12px;
  color: var(--muted);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.emoji-grid__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  padding: 2px 2px 6px;
}

.emoji-button {
  border: none;
  background: var(--surface-strong);
  border-radius: 10px;
  font-size: 18px;
  padding: 6px 0;
  cursor: pointer;
}

.emoji-button:hover {
  background: #f0f0f0;
}

body.mood--calm {
  --mood-bg: radial-gradient(circle at top, #f4f5f7 0%, #ffffff 45%, #f1f2f4 100%);
  --mood-image: url("/moods/bg-calm.jpg");
}

body.mood--rain {
  --mood-bg: linear-gradient(160deg, #f4f6f8 0%, #edf1f5 45%, #e6ebf0 100%);
  --mood-image: url("/moods/bg-rain.jpg");
}

body.mood--forest {
  --mood-bg: linear-gradient(160deg, #f4f7f4 0%, #edf3ef 50%, #e6efe8 100%);
  --mood-image: url("/moods/bg-forest.jpg");
}

body.mood--warm {
  --mood-bg: linear-gradient(160deg, #faf5ef 0%, #f7efe4 50%, #f2e7dd 100%);
  --mood-image: url("/moods/bg-warm.jpg");
}

.text-input:focus,
.text-area:focus {
  outline: none;
  border-color: #d0d0d0;
}
.text-area {
  min-height: 180px;
  resize: vertical;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.actions--right {
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #ececec;
  background: #f7f7f7;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.chip--neutral:hover {
  background: #f0f0f0;
}

.chip--danger {
  border-color: #f2d9d9;
  background: #fbf3f3;
  color: var(--danger);
}

.chip--danger:hover {
  background: #f9eded;
}

.calendar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar--list {
  display: none;
}

.calendar__header,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar__weekday {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.calendar__day {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  position: relative;
}

.calendar__day:hover {
  border-color: #d5d5d5;
}

.calendar__day.is-outside {
  background: var(--soft);
  color: var(--muted);
}

.calendar__day.is-today {
  border-color: var(--accent);
}

.calendar__day-number {
  font-size: 14px;
}

.calendar__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.calendar__emoji {
  font-size: 18px;
  line-height: 1;
}

.calendar__snippet {
  font-size: 12px;
  color: var(--muted);
}

.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.calendar-list__item.has-diary {
  border-color: #dddddd;
}

.calendar-list__item.is-outside {
  background: var(--soft);
  color: var(--muted);
}

.calendar-list__item.is-today {
  border-color: var(--accent);
}

.calendar-list__date {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.calendar-list__day {
  font-size: 16px;
}

.calendar-list__weekday {
  font-size: 12px;
  color: var(--muted);
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.month-nav__link {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.month-nav__label {
  min-width: 120px;
  text-align: center;
}

.inline-links {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.inline-links--spaced {
  margin-top: 32px;
  margin-bottom: 0;
  justify-content: flex-end;
}

.inline-links .text-link {
  white-space: nowrap;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-panel {
  display: grid;
  gap: 16px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.task-item--pill {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
}

.task-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.task-item input[type="checkbox"] {
  accent-color: var(--accent);
}

.task-item input[type="checkbox"]:checked + span {
  text-decoration: line-through;
  color: var(--muted);
}

.task-add {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.task-add--inline {
  margin-top: 0;
}

.task-row {
  display: flex;
  gap: 12px;
  align-items: center;
}


.select-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.form-errors {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #f8f4f4;
  color: var(--danger);
  font-size: 14px;
}

.flash {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
  border: 1px solid var(--line);
  z-index: 10;
}

.flash--alert {
  background: #f8f4f4;
  color: var(--danger);
}

.flash--notice {
  background: #eef6ef;
  color: #2a5c3a;
  border-color: #d6e8da;
}

@media (max-width: 720px) {
  .page {
    padding: 24px 16px 100px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .month-nav {
    width: 100%;
    justify-content: center;
  }

  .calendar__day {
    min-height: 64px;
    padding: 8px;
  }

  .calendar--grid {
    display: none;
  }

  .calendar--list {
    display: block;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button {
    width: 100%;
  }

  .task-row {
    flex-direction: column;
    align-items: stretch;
  }

  .task-row__form {
    flex-direction: column;
    align-items: stretch;
  }

  .select-row {
    flex-direction: column;
    align-items: stretch;
  }

}
