﻿:root {
  --bg: #fbf6ea;
  --surface: #ffffff;
  --surface-soft: #f7eddc;
  --text: #2f2a27;
  --muted: #7d7169;
  --primary: #bc6c25;
  --primary-dark: #8f4f17;
  --danger: #b13b3b;
  --border: #e5d8c3;
  --shadow: 0 20px 50px rgba(112, 74, 38, 0.14);
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(250, 239, 216, 0.95), transparent 34%),
    linear-gradient(135deg, #fffdf7 0%, var(--bg) 100%);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero, .editor-card, .list-card, .combined-calendar-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.78);
}

.today-label, .section-kicker {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 700;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
}

.today-date { margin-bottom: 0; color: var(--muted); font-size: 18px; }

.diary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.editor-card, .list-card, .combined-calendar-card { padding: 28px; }

.form-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field-group { display: grid; gap: 10px; margin-bottom: 20px; }
label, legend { font-weight: 700; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input, select { min-height: 52px; padding: 0 16px; }
input[type="file"] { padding: 13px 16px; }
input[type="range"] { min-height: auto; padding: 0; accent-color: var(--primary); }

textarea {
  min-height: 260px;
  padding: 16px;
  resize: vertical;
  line-height: 1.7;
}

.small-textarea { min-height: 120px; }

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(188, 108, 37, 0.12);
}

.important-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.important-check input { width: auto; min-height: auto; }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row strong {
  min-width: 38px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  text-align: center;
}

.media-preview {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}
.media-preview img { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.helper-text { margin: 0; color: var(--muted); font-size: 14px; }

.gratitude-box {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffdf9;
}
.gratitude-box legend { padding: 0 8px; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.primary-button, .ghost-button, .danger-button, .small-button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
}
.small-button { min-height: 42px; padding: 0 16px; background: var(--surface-soft); color: var(--primary-dark); border-color: var(--border); }
.small-button:disabled { cursor: not-allowed; opacity: 0.55; }
.primary-button { background: var(--primary); color: #ffffff; }
.primary-button:hover { background: var(--primary-dark); }
.ghost-button { background: var(--surface-soft); color: var(--primary-dark); border-color: var(--border); }
.danger-button { background: #fff1f1; color: var(--danger); border-color: #f1c7c7; }

.list-head, .calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.list-head h2, .calendar-head h2 { margin-bottom: 0; font-size: 22px; }
.count-badge {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 700;
}
.entry-list { display: grid; gap: 10px; }
.entry-item {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--text);
  text-align: left;
}
.entry-item:hover, .entry-item.active { border-color: var(--primary); background: #fff7ec; }
.entry-title { display: block; margin-bottom: 6px; font-weight: 800; }
.entry-meta, .entry-preview, .entry-tags { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }
.entry-preview, .entry-tags { margin-top: 8px; }
.empty-message {
  margin: 20px 0 0;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.calendar-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
}
.calendar-controls { display: flex; gap: 8px; }
.calendar-controls select { min-height: 42px; min-width: 96px; padding: 0 12px; }
.week-row, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.week-row { margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; }
.day-cell {
  min-height: 78px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--text);
  text-align: left;
  appearance: none;
}
.day-cell:hover { border-color: var(--primary); background: #fff7ec; }
.day-cell.outside-month {
  opacity: 0.42;
}

.day-cell.outside-month .day-number {
  background: #f3eadf;
  color: var(--muted);
}
.day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}
.day-icons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; font-size: 16px; }
.calendar-note { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stats-row > div, .gratitude-detail {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}
.stats-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
.gratitude-detail { margin-top: 14px; color: var(--muted); line-height: 1.7; }
.gratitude-detail strong { color: var(--text); }
.gratitude-detail ul { margin: 8px 0 0; padding-left: 20px; }


@media (max-width: 900px) {
  .app-shell { width: min(100% - 24px, 1180px); padding: 24px 0; }
  .hero, .editor-card, .list-card, .combined-calendar-card { padding: 22px; }
  .diary-layout, .two-columns, .calendar-area, .stats-row { grid-template-columns: 1fr; }
  textarea { min-height: 220px; }
  .button-row button { width: 100%; }
  .calendar-head { align-items: flex-start; flex-direction: column; }
  .calendar-controls { width: 100%; }
  .calendar-controls select { width: 100%; }
  .day-cell { min-height: 64px; padding: 7px; }
}











.notes-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}


.notes-card h2 {
  margin-bottom: 8px;
}



.notes-card {
  padding: 28px;
}



.note-favorite-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffdf9;
}

.note-favorite-check input {
  width: auto;
  min-height: auto;
}

.notes-area {
  margin-top: 24px;
}

.notes-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.note-sidebar {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.folder-list,
.note-list {
  display: grid;
  gap: 10px;
}

.folder-item,
.note-item {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--text);
  text-align: left;
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  font-weight: 700;
}

.folder-item strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.folder-item.active,
.folder-item:hover,
.note-item.active,
.note-item:hover {
  border-color: var(--primary);
  background: #fff7ec;
}

.note-workspace {
  min-width: 0;
}

.note-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}

.note-title {
  font-weight: 800;
}

.note-meta,
.note-preview {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.note-list {
  margin-top: 18px;
}

@media (max-width: 900px) {  .notes-layout {
    grid-template-columns: 1fr;
  }


    .notes-card {
    padding: 22px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .inline-form .small-button,
  .notes-card .primary-button,
  .notes-card .danger-button {
    width: 100%;
  }
}




