:root {
  --paper: #f7f4ee;
  --sheet: #fffdf8;
  --bar: #efeae1;
  --ink: #1c1915;
  --muted: #6f675e;
  --line: #e4dcd0;
  --blue: #1d4e89;
  --warn: #8a3d32;
  --sm: 13px;
  --md: 16px;
  --lg: 28px;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: var(--md);
  line-height: 1.45;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
}

button, input { font: inherit; color: inherit; }

button {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: var(--blue); }

.menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 0 22px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}

.brand, .today-label, .foot, .titlebar, label { font-size: var(--sm); }

.stage {
  width: min(440px, calc(100% - 32px));
  margin: 12vh auto 48px;
}

.window {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(70, 48, 22, 0.06);
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.chrome { display: flex; align-items: center; gap: 10px; color: var(--ink); }

.dots { display: flex; gap: 6px; }

.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
  background: #d9a598;
}

.dots i:nth-child(2) { background: #e0c98a; }

.dots i:nth-child(3) { background: #b7c9b4; }

.panel { padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 14px; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--lg);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lede { margin: 0; color: var(--muted); }

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

label { color: var(--muted); }

input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sheet);
}

input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.error {
  min-height: 1.2em;
  margin: 0;
  color: var(--warn);
  font-size: var(--sm);
}

button.primary {
  min-height: 44px;
  margin-top: 6px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--sheet);
}

.foot { display: flex; gap: 18px; margin: 16px 4px 0; }

.foot a { color: var(--muted); }

.sheet-page {
  width: min(680px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.sheet-page h1 {
  margin: 0 0 16px;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.summary { margin: 0; max-width: 62ch; }

.sheet-page h2 {
  margin: 32px 0 12px;
  font-size: var(--sm);
  font-weight: 500;
  color: var(--muted);
}

.draft-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

.draft-switch button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: var(--sm);
  color: var(--muted);
}

.draft-switch button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  position: relative;
  padding: 0 0 18px;
}

.timeline li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: #c8c8c4;
}

.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: #e4e4e0;
}

.timeline time { color: var(--muted); font-size: var(--sm); white-space: nowrap; }

.email-card { background: #fff; border: 1px solid #e6e6e2; border-radius: 12px; overflow: hidden; }

.email-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px 0 14px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.email-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-size: 12px;
}

.email-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.email-actions button { font-size: var(--sm); color: var(--muted); min-height: 32px; }

.email-rule { width: 1px; height: 14px; background: #ddd; }

.email-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #eee;
}

.email-row span { color: var(--muted); font-size: var(--sm); }

.email-body { display: block; padding: 12px 14px 8px; }

.email-body textarea {
  display: block;
  width: 100%;
  min-height: 140px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  resize: vertical;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}

.draft-note { margin: 10px 2px 0; color: var(--muted); font-size: var(--sm); }

.menu button { font-size: var(--sm); }

@media (max-width: 560px) {
  .menu { padding: 8px 16px; }
  .stage { margin-top: 48px; }
  .foot { flex-wrap: wrap; gap: 10px 18px; }
  .timeline li { grid-template-columns: 14px 1fr; }
  .timeline time { grid-column: 2; }
}
