@font-face {
  font-family: 'DM Sans';
  src: url('dm-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('instrument-serif.woff2') format('woff2');
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #202c26;
  background: #f6f7f3;
  --ink: #202c26;
  --muted: #55645c;
  --line: #dce2db;
  --green: #254a3a;
  --white: #fff;
  --light-green: #e7f0e6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #426e57; outline-offset: 3px; }
::selection { background: #d2e5d8; color: var(--ink); }

.frame { width: min(calc(100% - 80px), 1120px); margin-inline: auto; }
.site-header { background: #fafbf8; border-bottom: 1px solid #e0e5de; }
.header-inner { min-height: 68px; justify-content: space-between; gap: 12px; }
.header-inner, .wordmark, .privacy-pill, .workspace-footer p {
  display: flex;
  align-items: center;
}
.wordmark { gap: 10px; font-weight: 700; letter-spacing: -.025em; }
.brand-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: var(--green);
  display: grid;
  align-content: center;
  gap: 3px;
  padding-inline: 7px;
}
.brand-icon i { width: 14px; height: 1px; background: #e8f3e9; border-radius: 1px; }
.brand-icon i:nth-child(2) { width: 11px; }
.brand-icon i:nth-child(3) { width: 8px; }

.privacy-pill {
  gap: 7px;
  color: #2e5540;
  background: #edf3ec;
  border: 1px solid #dce8dc;
  border-radius: 99px;
  padding: 6px 11px;
  font-size: .875rem;
  font-weight: 600;
}
.lock-icon {
  flex: 0 0 11px;
  position: relative;
  height: 8px;
  margin-top: 4px;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.lock-icon::before {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 1px;
  right: 1px;
  height: 5px;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.workspace { padding-block: clamp(36px, 5.5vw, 78px) 30px; }
.intro { margin-bottom: 32px; }
h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(3.25rem, 7.6vw, 5.7rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .98;
  margin: 0 0 15px;
}
.intro p { color: var(--muted); font-size: 1.125rem; line-height: 1.5; margin: 0; }

.editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: hidden;
  box-shadow: 0 12px 32px -24px #233f31a0, 0 2px 5px #20382a08;
}
.pane { min-width: 0; display: flex; flex-direction: column; }
.output-pane { border-left: 1px solid var(--line); background: #fbfcfa; }
.pane-header, .pane-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 21px;
}
.pane-header { min-height: 65px; border-bottom: 1px solid #e5e9e4; background: #f9fbf8; }
h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1rem; font-weight: 700; }
.type-control { display: flex; align-items: center; gap: 9px; min-width: 0; }
.type-control label { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.select-wrap { position: relative; min-width: 0; }
.select-wrap::after {
  content: '';
  position: absolute;
  inset-inline-end: 13px;
  top: calc(50% - 4px);
  width: 7px;
  height: 7px;
  border: solid var(--green);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.type-control select {
  appearance: none;
  display: block;
  max-width: 100%;
  min-height: 40px;
  padding: 6px 29px 6px 10px;
  border: 1px solid #c7d5c9;
  border-radius: 8px;
  color: var(--green);
  background: var(--white);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.type-control select:hover { border-color: #789784; }
.tool-icon { width: 31px; height: 31px; border-radius: 8px; position: relative; background: var(--light-green); }
.tool-icon::before, .paper-icon::before {
  position: absolute;
  content: '';
  inset: 8px 10px;
  border: 1.5px solid #3b664d;
  border-radius: 2px;
}
.tool-icon::after, .paper-icon::after {
  position: absolute;
  content: '';
  top: 13px;
  left: 13px;
  width: 5px;
  height: 1px;
  background: #3b664d;
  box-shadow: 0 4px #3b664d;
}
.summary-icon::before { inset: 8px 8px; transform: rotate(-8deg); }
.summary-icon::after { width: 7px; left: 12px; transform: rotate(-8deg); }

.pane-footer { border-top: 1px solid #e5e9e4; margin-top: auto; min-height: 72px; }
textarea {
  display: block;
  width: 100%;
  height: clamp(260px, 39vh, 410px);
  resize: none;
  border: 0;
  margin: 0;
  padding: 22px;
  color: var(--ink);
  background: transparent;
  line-height: 1.65;
  font-size: 1rem;
  scrollbar-color: #b8c8bb transparent;
}
textarea:focus-visible { outline-offset: -3px; }
textarea::placeholder { color: #5d6a63; opacity: 1; }
textarea[aria-invalid='true'] { box-shadow: inset 0 0 0 2px #a2463e; }
.result { position: relative; min-height: clamp(260px, 39vh, 410px); }
.summary-text { font-size: 1.0625rem; }
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 20px;
}
.empty-state p { margin: 0; color: var(--muted); text-align: center; line-height: 1.5; }
.empty-icon {
  width: 52px;
  height: 52px;
  background: #eef4ed;
  border: 1px solid #e4ede3;
  border-radius: 15px;
  display: grid;
  place-items: center;
}
.paper-icon { display: block; width: 30px; height: 30px; position: relative; }
.paper-icon::before { inset: 5px 7px; border-radius: 3px; }
.paper-icon::after { top: 11px; left: 11px; width: 8px; }

.count { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 6px; }
.button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-height: 42px;
  padding-inline: 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  gap: 8px;
  font-size: .9375rem;
  font-weight: 700;
}
.text-button { background: transparent; color: #355a46; }
.text-button:hover:not(:disabled) { background: #eaf0e9; }
.text-button:disabled { color: #66726b; opacity: .8; }
.primary { background: var(--green); color: #fff; padding-inline: 15px; }
.primary:hover { background: #1c3a2d; }
.sparkle { font-size: 1rem; font-weight: 400; }
.secondary { background: #fff; color: var(--green); border-color: #c7d5c9; min-width: 86px; }
.secondary:hover:not(:disabled) { background: #edf3ec; }
.secondary:disabled { background: #f2f5f0; color: #5d6a63; border-color: #dce2db; }
.copy-icon { position: relative; width: 14px; height: 14px; }
.copy-icon::before, .copy-icon::after { content: ''; position: absolute; border: 1.4px solid currentColor; border-radius: 2px; }
.copy-icon::before { inset: 0 4px 4px 0; border-right: 0; border-bottom: 0; }
.copy-icon::after { inset: 3px 0 0 3px; }

.input-message { margin: 0; padding: 9px 21px; color: #8d342d; font-size: .875rem; background: #fcf0ee; }
.workspace-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 20px;
  margin-top: 18px;
  font-size: .875rem;
  line-height: 1.5;
}
.workspace-footer p { gap: 8px; color: var(--muted); margin: 0; }
.workspace-footer a { color: var(--green); text-underline-offset: 3px; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 795px) {
  .frame { width: calc(100% - 32px); }
  .intro { margin-bottom: 22px; }
  .intro p { font-size: 1rem; }
  .editor { grid-template-columns: 1fr; }
  .output-pane { border-left: 0; border-top: 1px solid var(--line); }
  .pane-header, .pane-footer { padding-inline: 14px; }
  .pane-header { min-height: 59px; }
  .pane-footer { min-height: 64px; }
  textarea { height: 240px; padding: 16px; }
  .result { min-height: 190px; }
  .summary-text { height: 215px; }
  .workspace-footer { flex-wrap: wrap; }
}

@media (max-width: 350px) {
  .header-inner { gap: 6px; }
  .wordmark { gap: 5px; }
  .brand-icon { flex-shrink: 0; }
  .privacy-pill { padding-inline: 7px; }
  .actions { gap: 2px; }
  .button, .text-button { padding-inline: 9px; }
}

@media (max-width: 425px) {
  .output-pane .pane-header { flex-wrap: wrap; row-gap: 8px; }
  .type-control { margin-inline-start: auto; }
}
