:root {
  color-scheme: light;
  --paper: #F8F7F3;
  --ink: #263B39;
  --body: #48534F;
  --green: #426345;
  --muted: #626f66;
  --rule: #d5d9d0;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --gutter: 5.3vw;
  background: var(--paper);
  color: var(--body);
  font: 16px/1.5 var(--sans);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: var(--paper);
}
.symbols { display: none; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); }
button, select, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:where(button, a, input, select, [tabindex]):focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip, .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { clip-path: none; height: auto; width: auto; padding: 10px 18px; z-index: 2; background: white; color: var(--green); }
.masthead { background: var(--paper); }
.topline {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(40px + env(safe-area-inset-top)) 0 24px;
  border-bottom: 1px solid var(--rule);
}
.brand { color: var(--ink); font: 600 24px/1 var(--sans); letter-spacing: -.055em; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--green); }
.local { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 12px; font-weight: 550; }
.local .icon { width: 15px; height: 15px; }
.intro, .layout, .page-footer { width: min(100%, 1196px); margin-inline: auto; }
.intro { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 186px; padding: 32px 310px 36px 0; }
.intro h1 { font: 400 clamp(50px, 5.1vw, 70px)/1.05 var(--serif); letter-spacing: -.055em; }
.intro p { margin-top: 10px; font-size: clamp(15px, 1.4vw, 18px); }
.paper-study { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); width: min(28vw, 318px); height: auto; pointer-events: none; }
.layout { display: grid; grid-template-columns: minmax(185px, .31fr) minmax(0, 1fr); gap: clamp(24px, 3.5vw, 52px); align-items: start; }
.tools { padding-top: 5px; }
.tools h2 { margin: 0 0 14px 12px; font: 650 11px/1.3 var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
#tool-list { display: grid; gap: 4px; }
.tools a {
  display: flex; align-items: center; gap: 13px; min-height: 46px;
  padding: 8px 14px; border: 1px solid transparent; border-radius: 8px;
  color: var(--body); font-size: 15px; font-weight: 500; text-decoration: none;
}
.tools a > .icon { width: 19px; height: 19px; color: #58705b; }
.tools a:hover { background: #eeefe7; }
.tools a[aria-current] { border-color: #d6e0ce; background: #e7ecdf; color: var(--green); font-weight: 650; }
.tools a[aria-current]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.workspace { overflow: hidden; border: 1px solid #cfd5c9; border-radius: 14px; background: #fdfcf8; box-shadow: 0 3px 8px #293d2305, 0 16px 35px -28px #2a3b2380; }
.workspace:focus:not(:focus-visible) { outline: none; }
.tool-heading { display: flex; align-items: center; gap: 17px; padding: 27px clamp(20px, 2.6vw, 36px) 23px; }
.tool-icon { display: grid; place-items: center; flex: none; width: 47px; height: 47px; border: 1px solid #d6dfce; border-radius: 13px; color: var(--green); background: #edf0e6; }
.tool-icon .icon { width: 26px; height: 26px; stroke-width: 1.45; }
.tool-heading h2, dialog h2 { font: 400 clamp(29px, 2.6vw, 38px)/1.12 var(--serif); letter-spacing: -.045em; }
.tool-heading p { margin-top: 5px; font-size: 14px; }
.workbody { padding: 0 clamp(20px, 2.6vw, 36px) 27px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 244px; padding: 20px; border: 1.5px dashed #a5b39c; border-radius: 9px; background: #f3f5ed; text-align: center; }
.drop.dragover { outline: 2px solid var(--green); outline-offset: -2px; background: #e5eddd; }
.drop-art { width: 86px; height: 66px; margin: 0 0 8px; }
.drop h3 { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.035em; }
.drop-description { margin-top: 3px; font-size: 13px; color: var(--muted); }
.choose, .run, .download {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 40px; padding: 9px 16px; border: 1px solid transparent; border-radius: 6px;
  background: var(--green); color: #fff; font: 600 14px/1.3 var(--sans); text-decoration: none;
}
.choose:hover, .run:not(:disabled):hover, .download:hover { background: #334e36; }
.choose .icon, .run .icon, .download .icon { width: 17px; height: 17px; }
.choose { margin-top: 17px; }
.run:disabled { cursor: default; background: #e7e9e1; color: #606b60; }
.choose:disabled, .file-button:disabled, .options :disabled { opacity: .6; cursor: default; }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--rule); padding: 17px clamp(20px, 2.6vw, 36px); background: #f8f9f3; }
.hint, .page-footer span, .page-footer button { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.hint .icon, .page-footer .icon { width: 15px; height: 15px; }
.page-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--rule); }
.page-footer button { padding: 5px 0; border: 0; background: transparent; }
.page-footer button:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.files { padding: 0; margin: 0; list-style: none; }
.files:not(:empty) { margin-top: 14px; border-top: 1px solid var(--rule); }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.files .file-glyph { color: var(--green); }
.file-detail { min-width: 0; margin-right: auto; }
.file-name { display: block; color: var(--ink); font-weight: 560; font-size: 14px; overflow-wrap: anywhere; }
.file-size { display: block; color: var(--muted); font-size: 12px; }
.file-actions { display: flex; }
.file-button { display: grid; place-items: center; width: 36px; height: 36px; color: var(--green); background: transparent; border: 0; border-radius: 4px; }
.file-button .icon { width: 16px; height: 16px; }
.file-button:hover:not(:disabled) { background: #e7ecdf; }
.drop.populated { min-height: 78px; flex-flow: row wrap; justify-content: space-between; text-align: left; gap: 8px; padding: 14px; }
.populated .drop-art, .populated .drop-description { display: none; }
.populated h3 { font-size: 16px; }
.populated .choose { margin: 0; }
.options:not(:empty) { display: grid; gap: 13px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.field input, .field select { width: 100%; padding: 9px 10px; min-height: 40px; border-radius: 5px; border: 1px solid #aeb8a8; background: #fffefa; color: var(--ink); font-size: 14px; font-weight: 400; }
.option-note { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
#notice:not(:empty) { padding: 12px 0 0; font-size: 14px; }
#notice.error { color: #92432d; }
.result { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-top: 18px; padding: 14px; border: 1px solid #c6d6bf; border-radius: 7px; background: #edf3e8; }
.result p { font-size: 13px; overflow-wrap: anywhere; }
.result strong { display: block; color: var(--green); font-size: 15px; }
dialog { width: min(410px, calc(100% - 32px)); padding: 25px; border: 1px solid var(--rule); border-radius: 12px; color: var(--body); background: var(--paper); }
dialog::backdrop { background: #243a3580; }
dialog p { margin-top: 13px; font-size: 15px; }
.no-script { padding: 15px; text-align: center; }
@media (min-width: 1600px) { .topline { padding-bottom: 28px; } .intro { min-height: 204px; } }
@media (max-width: 760px) {
  :root { --gutter: clamp(16px, 5.3vw, 27px); }
  .masthead { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; padding-top: calc(22px + env(safe-area-inset-top)); }
  .topline, .intro { display: contents; }
  .brand { font-size: 21px; }
  .local, .paper-study { display: none; }
  .intro h1 { grid-column: 2; text-align: right; font: 500 19px/1.2 var(--sans); letter-spacing: -.03em; }
  .intro p { grid-column: 1 / -1; margin: 18px 0 20px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15px; }
  .layout { display: block; }
  .tools { padding: 0 0 16px; }
  .tools h2 { margin: 0 0 8px 0; }
  #tool-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .tools a { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-height: 61px; padding: 6px 2px; border-color: var(--rule); border-radius: 6px; font-size: clamp(11px, 2.9vw, 14px); text-align: center; line-height: 1.2; }
  .tools a[aria-current]::after { display: none; }
  .tools a > .icon { width: 18px; height: 18px; }
  .workspace { border-radius: 10px; }
  .tool-heading { align-items: start; gap: 12px; padding: 19px 16px 17px; }
  .tool-icon { width: 36px; height: 36px; border-radius: 9px; }
  .tool-icon .icon { width: 21px; height: 21px; }
  .tool-heading h2 { font-size: 27px; }
  .tool-heading p { margin-top: 3px; font-size: 13px; }
  .workbody { padding: 0 14px 16px; }
  .drop { min-height: 205px; padding: 16px; }
  .drop-art { width: 73px; height: 56px; }
  .drop h3 { font-size: 18px; }
  .workspace-footer { padding: 12px 14px; gap: 10px; }
  .hint { align-items: flex-start; font-size: 11px; }
  .hint .icon { width: 13px; height: 15px; }
  .run { flex-shrink: 0; min-height: 42px; padding-inline: 11px; font-size: 13px; }
  .page-footer { margin-top: 22px; padding-top: 10px; align-items: center; flex-wrap: wrap; }
  .page-footer button { min-height: 40px; }
  .file-button { width: 34px; height: 42px; }
  .file-actions { gap: 2px; }
}
@media (max-width: 370px) { .workspace-footer { align-items: stretch; flex-direction: column; } .run { align-self: end; } }
