:root {
  --paper: #fffdf7;
  --ink: #2d2a26;
  --muted: #76716b;
  --line: #e5ddd0;
  --panel: #ffffff;
  --pink: #f47fa2;
  --pink-dark: #cd4772;
  --mint: #79c7b3;
  --yellow: #ffd166;
  --sky: #6aa9ff;
  --lavender: #b28dff;
  --shadow: 0 18px 50px rgba(63, 44, 29, 0.14);
  font-family:
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(244, 127, 162, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(121, 199, 179, 0.18), transparent 38%),
    var(--paper);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 24px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.editor-panel,
.history-panel {
  min-width: 0;
  border: 1px solid rgba(229, 221, 208, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.editor-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  padding: 26px;
}

.history-panel {
  padding: 24px;
}

.brand-row,
.history-header,
.action-row,
.note-meta,
.list-tools,
.summary-row {
  display: flex;
  align-items: center;
}

.brand-row,
.history-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--pink-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

h2 {
  font-size: 1.8rem;
}

.save-state,
.stats-strip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff8e7;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.stats-strip {
  gap: 5px;
  color: var(--ink);
}

.stats-strip strong {
  font-size: 1.25rem;
}

.diary-form {
  display: grid;
  gap: 13px;
}

.field-label,
.mood-field legend {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

input[type="date"],
.search-box input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input[type="date"],
.search-box input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 138px;
  resize: vertical;
  padding: 12px;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(244, 127, 162, 0.16);
  background: #fff;
}

.mood-field {
  min-width: 0;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mood-option {
  position: relative;
  display: grid;
  min-height: 86px;
  place-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.mood-option:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 127, 162, 0.6);
}

.mood-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.mood-option:has(input:checked) {
  border-color: var(--pink);
  background: #fff1f6;
  color: var(--pink-dark);
  box-shadow: 0 10px 22px rgba(244, 127, 162, 0.18);
}

.mood-face {
  font-size: 1.75rem;
  line-height: 1;
}

.note-meta {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.primary-button,
.ghost-button,
.entry-actions button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.primary-button {
  background: var(--pink);
  color: white;
  box-shadow: 0 12px 24px rgba(205, 71, 114, 0.22);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(205, 71, 114, 0.28);
}

.ghost-button,
.entry-actions button {
  border-color: var(--line);
  background: #fffefb;
  color: var(--ink);
}

.ghost-button:hover,
.entry-actions button:hover {
  border-color: var(--pink);
}

.summary-row {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.biorhythm {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8e7, #fffefb);
  padding: 16px;
}

.biorhythm-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.biorhythm strong {
  display: block;
  font-size: 1.12rem;
  line-height: 1.35;
}

.rhythm-chart {
  min-height: 180px;
  overflow: hidden;
  border: 1px solid rgba(229, 221, 208, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 248, 231, 0.42)),
    #fffefb;
}

.rhythm-svg {
  display: block;
  width: 100%;
  height: 180px;
}

.rhythm-grid line {
  stroke: rgba(118, 113, 107, 0.22);
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.rhythm-area {
  fill: url("#rhythm-area-gradient");
}

.rhythm-wave {
  fill: none;
  stroke: url("#rhythm-line-gradient");
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
  filter: drop-shadow(0 7px 10px rgba(205, 71, 114, 0.18));
}

.rhythm-point circle {
  fill: #fffefb;
  stroke: var(--pink);
  stroke-width: 3;
}

.rhythm-point text {
  font-size: 14px;
}

.rhythm-axis-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.biorhythm-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffefb;
  padding: 0 11px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.list-tools {
  gap: 10px;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  flex: 1 1 auto;
}

.search-box span {
  position: absolute;
  top: -999px;
  left: -999px;
}

.list-tools select {
  flex: 0 0 164px;
}

.empty-state {
  display: grid;
  gap: 6px;
  border: 1px dashed #dccfbd;
  border-radius: 8px;
  background: rgba(255, 248, 231, 0.62);
  padding: 20px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.entry-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  padding: 16px;
}

.entry-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.entry-date {
  font-size: 1rem;
  font-weight: 900;
}

.mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff1f6;
  color: var(--pink-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.entry-note {
  margin: 0;
  color: #413c36;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-actions button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 0.85rem;
}

.entry-actions .danger-button {
  color: #b72b42;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(640px, calc(100% - 24px));
    padding: 12px 0 24px;
  }

  .editor-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .editor-panel,
  .history-panel {
    padding: 18px;
  }

  .brand-row,
  .history-header,
  .list-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .save-state,
  .stats-strip {
    align-self: flex-start;
  }

  .mood-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mood-option {
    min-height: 76px;
  }

  .list-tools select {
    flex-basis: auto;
  }

  .primary-button,
  .ghost-button {
    flex: 1 1 150px;
  }
}
    