:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --ink: #171717;
  --muted: #77736c;
  --line: #dedbd4;
  --focus: #2f6f68;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(920px, calc(100% - 40px));
  height: 72px;
  margin: 0 auto;
}

.site-header a {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
}

.page {
  display: flex;
  flex: 1;
  align-items: flex-start;
  justify-content: center;
  padding: 88px 20px 56px;
}

.writing-area {
  width: min(620px, 100%);
  margin: 0 auto;
  text-align: center;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(1.45rem, 5vw, 2.2rem);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.save-state,
.account-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.account-state {
  margin-top: 12px;
  text-align: center;
}

.save-state {
  min-height: 1.5em;
  margin-top: 10px;
  text-align: center;
}

textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.8;
  resize: vertical;
}

textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47, 111, 104, 0.12);
}

.save-button,
.entry-actions button {
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.save-button {
  width: 100%;
  margin-top: 12px;
}

.save-button:disabled,
.entry-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.entries {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.entry-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
}

.entry-card textarea {
  min-height: 86px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.4);
}

.entry-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.entry-actions time {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.entry-actions button {
  min-width: 72px;
  padding: 0 14px;
}

.entry-actions .delete-button {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

@media (max-width: 520px) {
  .site-header {
    width: min(100% - 28px, 920px);
    height: 62px;
  }

  .page {
    padding: 54px 14px 40px;
  }

  textarea {
    min-height: 96px;
  }

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

  .entry-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
