@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Shippori+Mincho:wght@500;600;700&display=swap');

:root {
  --paper: #f7f4ee;
  --ink: #292724;
  --muted: #8b877f;
  --line: #ded9cf;
  --accent: #df674b;
  --accent-dark: #bd4d35;
  --card: #fffdf8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Shippori Mincho', serif;
}

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

.shell { width: min(100% - 40px, 760px); margin: 0 auto; padding: 54px 0 42px; }
.masthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 52px; }
.eyebrow, .section-kicker, footer, .text-button, label > span { font: 500 11px/1.4 'DM Mono', monospace; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow { color: var(--accent); margin: 0 0 12px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(52px, 10vw, 78px); line-height: .82; letter-spacing: -.08em; font-weight: 700; }
h1 span { color: var(--accent); }
.lede { color: var(--muted); font-size: 16px; line-height: 1.65; text-align: right; }

.composer { background: var(--card); border: 1px solid var(--line); padding: 27px 30px 30px; box-shadow: 8px 8px 0 rgba(41,39,36,.035); }
.section-kicker { color: var(--accent); margin-bottom: 7px; }
h2 { font-size: 21px; line-height: 1.4; font-weight: 600; }
.section-heading { margin-bottom: 23px; }
.emotion-field { margin-bottom: 20px; }
.emotion-field > label > span { margin-bottom: 10px; }
.recent-emotions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.emotion-chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; color: var(--muted); background: transparent; font-size: 13px; }
.emotion-chip:hover, .emotion-chip.is-selected { border-color: var(--accent); color: var(--accent-dark); background: #fff3ed; }
.emotion-selects { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; margin-bottom: 17px; }
label { display: block; width: 100%; }
label > span { display: block; color: var(--muted); margin-bottom: 7px; }
input, textarea { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); outline: 0; }
input { padding: 6px 2px 9px; font: 15px 'DM Mono', monospace; }
select { width: 100%; padding: 7px 27px 9px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--ink); background: var(--card); font-size: 16px; }
select:focus { outline: 0; border-color: var(--accent); }
textarea { padding: 4px 2px 8px; font-size: 18px; line-height: 1.7; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: #bcb7ae; }
.add-button { display: block; margin: 19px 0 0 auto; border: 0; border-radius: 999px; padding: 12px 21px; background: var(--accent); color: #fff; font-size: 15px; transition: transform .15s, background .15s; }
.add-button:hover { background: var(--accent-dark); transform: translateY(-2px); }
.add-button span { font-family: sans-serif; font-size: 18px; vertical-align: -1px; }

.archive { margin-top: 60px; }
.archive-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; border-bottom: 1px solid var(--line); }
.archive-header .section-heading { margin-bottom: 15px; }
#memo-count { color: var(--muted); font: 400 12px 'DM Mono', monospace; vertical-align: 3px; }
.data-actions { display: flex; gap: 15px; padding-bottom: 15px; }
.text-button { padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; }
.text-button:hover { color: var(--accent); }
.status { min-height: 24px; color: var(--accent); font: 11px 'DM Mono', monospace; padding-top: 10px; }
.memo-list { display: grid; gap: 13px; }
.memo-card { position: relative; padding: 20px 50px 20px 0; border-bottom: 1px solid var(--line); }
.memo-date { color: var(--muted); font: 11px 'DM Mono', monospace; letter-spacing: .02em; margin-bottom: 8px; }
.memo-emotion { display: inline-block; margin-bottom: 7px; color: var(--accent-dark); font: 11px 'DM Mono', monospace; }
.memo-title { font-size: 18px; line-height: 1.5; font-weight: 600; margin-bottom: 3px; }
.memo-text { color: #59554e; font-size: 15px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.memo-actions { position: absolute; top: 18px; right: 0; display: flex; gap: 8px; }
.edit-button, .delete-button { border: 0; padding: 4px; color: #b9b4ab; background: transparent; font-size: 11px; }
.edit-button:hover, .delete-button:hover { color: var(--accent); }
.delete-button { font: 20px/1 sans-serif; }
.edit-form { display: grid; gap: 13px; }
.edit-form .emotion-selects { margin-top: -3px; }
.edit-actions { display: flex; justify-content: flex-end; gap: 12px; }
.edit-actions button { border: 0; border-radius: 999px; padding: 8px 15px; color: var(--muted); background: #eeeae2; font-size: 12px; }
.edit-actions .save-edit { color: #fff; background: var(--accent); }
.delete-button:hover { color: var(--accent); }
.empty { padding: 58px 0 70px; color: var(--muted); text-align: center; }
.empty p:first-child { color: var(--ink); font-size: 20px; margin-bottom: 8px; }
.empty p:last-child { font-size: 13px; }
footer { margin-top: 70px; color: #b4afa6; text-align: center; font-size: 9px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 760px); padding-top: 32px; }
  .masthead { margin-bottom: 36px; }
  .lede { font-size: 13px; }
  .composer { padding: 23px 19px 25px; }
  .form-row { display: block; }
  .emotion-selects { display: block; }
  .emotion-selects select + select { margin-top: 12px; }
  .form-row label { margin-bottom: 18px; }
  .add-button { width: 100%; }
  .archive { margin-top: 45px; }
  .archive-header { display: block; }
  .data-actions { padding: 0 0 14px; }
}
