:root {
  color-scheme: light;
  --background: #fbf6ed;
  --paper: #fffdf9;
  --ink: #24342c;
  --muted: #58645b;
  --green: #28433a;
  --green-dark: #1d332c;
  --red: #8f3d42;
  --line: #e1d9cb;
  --serif: Georgia, 'Times New Roman', serif;
  font: 100%/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--green); text-underline-offset: 0.21em; }
button, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.55; cursor: default; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; }
h2 { font-size: clamp(1.65rem, 3vw, 2rem); line-height: 1.14; letter-spacing: -0.025em; }
.wrap { width: min(71rem, calc(100% - 4rem)); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: absolute;
  z-index: 1;
  inset: .5rem auto auto .5rem;
  padding: .65rem .9rem;
  background: var(--paper);
}

.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-inner { min-height: 4.2rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -.015em;
  white-space: nowrap;
}

.site-header nav { display: flex; gap: clamp(.8rem, 3vw, 1.8rem); }
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav a:hover, .site-footer a:hover { text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: 1.19fr 1fr;
  align-items: center;
  gap: clamp(1.75rem, 6vw, 4.75rem);
  padding-block: clamp(1.9rem, 5vw, 3.25rem) clamp(1.8rem, 4vw, 2.7rem);
}

.hero h1 {
  color: var(--green-dark);
  font-size: clamp(2.35rem, 4.8vw, 4.25rem);
  line-height: 1.03;
  letter-spacing: -.067em;
}

.hero h1 em {
  display: block;
  color: var(--red);
  font-weight: inherit;
}

.hero p {
  margin-top: 1.12rem;
  max-width: 29rem;
  color: var(--muted);
  font-size: 1.04rem;
}

.hero-photo {
  width: 100%;
  height: clamp(12rem, 22vw, 16rem);
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: 1.12rem;
  outline: 1px solid #2b423a19;
  box-shadow: 0 12px 28px #40312716;
}

.workspace {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  align-items: start;
  gap: 1.35rem;
  scroll-margin-top: 1rem;
}

.form-panel, .results-panel {
  min-width: 0;
  padding: clamp(1.15rem, 3vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--paper);
}

.form-panel { box-shadow: 0 9px 25px #4536200a; }
.results-panel { background: #f2efe5; }
form { margin-top: 1.25rem; }
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .85rem; }
label { display: block; font-size: .875rem; font-weight: 650; }
.memory-label { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-top: 1.03rem; }
.optional { color: var(--muted); font-size: .78rem; font-weight: 400; }

select, textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: .42rem;
  border: 1px solid #d5cebf;
  border-radius: .58rem;
  background: #fffefa;
  padding: .63rem .7rem;
  color: var(--ink);
  font-size: 1rem;
}

select { min-height: 2.8rem; }
textarea { resize: vertical; min-height: 5rem; }
textarea::placeholder { color: #6b7067; }
.field-hint { margin-top: .48rem; color: var(--muted); font-size: .83rem; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  width: 100%;
  min-height: 3rem;
  margin-top: 1.15rem;
  padding: .65rem 1rem;
  border: 1px solid var(--green);
  border-radius: .65rem;
  background: var(--green);
  color: #fffbf1;
  font-weight: 650;
  text-align: start;
}

.primary-button:hover:not(:disabled) { background: var(--green-dark); }
.primary-button span { font-size: 1.25rem; line-height: 1; }
.privacy-note { margin-top: .7rem; color: var(--muted); font-size: .79rem; }
noscript p { margin-top: .7rem; }

.results-heading { display: flex; align-items: start; justify-content: space-between; gap: .65rem; }
.results-heading p { margin-top: .4rem; color: var(--muted); font-size: .875rem; }
.limit {
  flex: 0 0 auto;
  margin-top: .12rem;
  padding: .24rem .58rem;
  border: 1px solid #dbd9c8;
  border-radius: 2rem;
  color: var(--green);
  background: #f9f8ee;
  font-size: .73rem;
  font-weight: 650;
}

.drafts { display: grid; gap: .62rem; margin-top: .85rem; }
.draft { min-width: 0; padding: .62rem .75rem .52rem; border: 1px solid #e0dacb; border-radius: .78rem; background: var(--paper); }
.draft-text {
  min-height: 3.45rem;
  margin: 0;
  padding: .2rem .1rem;
  border-color: transparent;
  background: transparent;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.42;
}

.draft-text:hover { border-color: var(--line); }
.draft-text:focus { border-color: #bebcad; outline-offset: 1px; }
@supports (field-sizing: content) {
  .draft-text { field-sizing: content; }
}

.draft-footer { display: flex; justify-content: space-between; align-items: center; gap: .65rem; margin-top: .1rem; }
.draft-count { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.draft-actions { display: flex; align-items: center; gap: .35rem; }
.copy-button, .polish-button {
  min-height: 2.75rem;
  min-width: 4.25rem;
  padding: .36rem .65rem;
  border: 1px solid #d7dacf;
  border-radius: .51rem;
  background: #f0f2eb;
  color: var(--green-dark);
  font-size: .82rem;
  font-weight: 680;
}

.copy-button:hover:not(:disabled) { background: #e5eadf; }
.polish-button { background: var(--paper); }
.polish-button:hover:not(:disabled):not([aria-disabled="true"]) { background: #f0f2eb; }
.polish-button[aria-disabled="true"] { opacity: .65; cursor: wait; }
.polish-status { color: var(--muted); font-size: .78rem; }
.polish-status:not(:empty) { margin-top: .25rem; }
.examples, .how-to { margin-top: clamp(2.25rem, 5vw, 4.1rem); scroll-margin-top: 1rem; }
.section-intro p, .how-to p, .how-to li { color: var(--muted); }
.section-intro p { margin-top: .5rem; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: 1.15rem; }
.example { padding: 1.05rem 1.2rem; border: 1px solid var(--line); border-radius: .9rem; background: #fefbf4; }
.example h3 { font-size: 1.25rem; }
blockquote { margin: .75rem 0 0; padding-inline-start: .7rem; border-inline-start: 2px solid #d6aaa3; }
.how-to ol { margin-block: .75rem; padding-inline-start: 1.4rem; }
.how-to li + li { margin-top: .28rem; }
.how-to h3 { margin-top: 1.15rem; }
.how-to h3 + p { margin-top: .25rem; }
.site-footer { margin-top: 3.25rem; border-top: 1px solid var(--line); }
.footer-inner { min-height: 4rem; padding-block: .9rem; color: var(--muted); font-size: .84rem; }
.footer-inner a { font-weight: 600; }

@media (max-width: 46rem) {
  .wrap { width: calc(100% - 2rem); }
  .hero { grid-template-columns: 1fr; gap: 1.25rem; }
  .hero h1 { font-size: clamp(2.15rem, 7.8vw, 3.1rem); }
  .hero p { margin-top: .75rem; font-size: .95rem; }
  .hero-photo { display: none; }
  .workspace { grid-template-columns: 1fr; gap: .85rem; }
}

@media (max-width: 29rem) {
  .header-inner { min-height: 3.65rem; gap: .55rem; }
  .brand { gap: .44rem; font-size: .88rem; }
  .brand img { width: 28px; height: 28px; }
  .site-header nav { gap: .72rem; }
  .site-header nav a { font-size: .77rem; }
  .example-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: start; gap: .4rem; }
}

@media (max-width: 22rem) {
  .site-header nav a:first-child { display: none; }
}
