:root {
    color-scheme: light;
    --ink: #1b2b21; --muted: #54645a; --green: #214f38; --paper: #f7f8f2;
    --edge: #dde4d9; --white: #fff; --mint: #e8f0e5; --lime: #e2efac;
    --serif: Georgia, 'Times New Roman', serif;
    font: 16px/1.5 'Segoe UI', sans-serif;
  }
  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; background: var(--paper); color: var(--ink); }
  button, input, textarea { font: inherit; }
  button { cursor: pointer; }
  [hidden] { display: none !important; }
  :focus-visible { outline: 3px solid #769442; outline-offset: 3px; }
  a { color: inherit; }
  h1, h2, p { margin: 0; }
  .wrap { width: min(1120px, calc(100% - 72px)); margin-inline: auto; }
  .top { border-bottom: 1px solid var(--edge); }
  .top .wrap { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
  .top nav { display: flex; align-items: center; gap: 12px; }
  .top nav a { font-size: .9rem; color: var(--green); }
  .brand { display: inline-flex; gap: 11px; align-items: center; font: bold 29px/1 var(--serif); text-decoration: none; }
  .mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--green); color: var(--lime); font: bold 30px/1 var(--serif); padding-top: 8px; }
  .top-button, .icon-button { border: 1px solid #c9d7c8; background: transparent; color: var(--green); border-radius: 10px; padding: 8px 14px; font-size: .9rem; font-weight: 650; }
  .top-button:hover, .icon-button:hover { background: var(--mint); }
  .spark { margin-right: 6px; }
  .hero { border-bottom: 1px solid var(--edge); padding: 45px 0 30px; }
  .eyebrow { color: var(--green); font-size: .79rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; }
  h1 { font: 500 clamp(3rem, 7vw, 4.75rem)/1.01 var(--serif); letter-spacing: -.061em; margin: 0 0 12px; }
  .hero p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; }
  .home:not(.word-page) .hero .eyebrow { display: none; }
  .search { display: flex; width: min(710px, 100%); gap: 8px; margin: 19px 0 12px; padding: 6px; background: white; border: 1px solid #cfdacd; border-radius: 14px; }
  .search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 12px; color: var(--ink); border-radius: 8px; }
  .search-field { position:relative; display:flex; flex:1; min-width:0; }
  #word-suggestions { position:absolute; top:100%; left:0; right:0; z-index:3; padding:.3rem; margin:.2rem 0; list-style:none; background:white; border:1px solid #c8d5c5; border-radius:.55rem; box-shadow:0 6px 18px #20341e1a; }
  #word-suggestions li { padding:.4rem .7rem; cursor:pointer; border-radius:.3rem; overflow-wrap:anywhere; }
  #word-suggestions li:hover, #word-suggestions [aria-selected=true] { background:#e5f0df; }
  .button { border: 1px solid transparent; border-radius: 9px; padding: 10px 20px; font-weight: 650; background: var(--green); color: white; }
  .button:hover { background: #193d2b; }
  .examples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: .875rem; }
  .example { border: 1px solid var(--edge); border-radius: 999px; background: transparent; color: var(--green); padding: 3px 11px; }
  .example:hover { background: var(--mint); }
  a.example { text-decoration: none; }
  .word-page .hero h1 { font-size: clamp(2.4rem, 5vw, 3.65rem); letter-spacing: -.05em; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 358px); gap: 24px; align-items: start; padding-block: 24px 38px; }
  .result, .trial { border-radius: 18px; padding: 28px; }
  .result { border: 1px solid var(--edge); background: white; }
  .result h2, .trial h2, dialog h2 { font: 500 2.45rem/1.05 var(--serif); letter-spacing: -.04em; overflow-wrap: anywhere; }
  .result h2 { margin: 5px 0 8px; }
  .caption, .usage { color: var(--muted); font-size: .9rem; }
  .trial-jump { display: none; }
  .groups { margin-top: 19px; }
  .sense { padding: 15px 0; border-top: 1px solid var(--edge); }
  .sense:last-child { padding-bottom: 0; }
  .sense h3 { font-size: .98rem; margin: 0 0 8px; }
  #word-details ol { margin: 0 0 8px; padding-inline-start: 1.5rem; }
  #word-details li + li { margin-top: .4rem; }
  #word-details > a { font-size: .85rem; }
  .usage { margin: -4px 0 11px; }
  .chips { display: flex; flex-wrap: wrap; gap: 7px; }
  .chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; background: var(--mint); color: var(--green); padding: 5px 10px; font-size: .91rem; }
  .chip:hover { border-color: #9eb79d; }
  .copy-icon { width: 13px; height: 13px; flex: none; opacity: .8; }
  .trial { background: #193e2c; color: #fff; }
  .trial .eyebrow { color: var(--lime); }
  .trial h2 { margin: 10px 0 10px; font-size: 2rem; }
  .trial .intro, .trial .hint { color: #e2ebdf; font-size: .9rem; }
  .trial form { margin-top: 18px; }
  .trial label { display: block; font-size: .9rem; font-weight: 650; margin-bottom: 6px; }
  #trial-occurrence { display:block; width:100%; margin:6px 0 12px; padding:8px; font:inherit; }
  textarea { display: block; width: 100%; padding: 10px 12px; min-height: 90px; resize: vertical; border: 1px solid #668877; border-radius: 9px; background: #234a37; color: white; }
  textarea::placeholder { color: #d3e2d5; opacity: 1; }
  .trial .sample { display: inline-block; font-size: .875rem; padding: 4px 0; margin: 3px 0 9px; color: var(--lime); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; }
  .trial .button, .dialog-buy { width: 100%; }
  .trial .button { background: var(--lime); color: #24361d; }
  .trial .button:hover { background: #f0fac9; }
  .trial .hint { margin-top: 11px; }
  .error { margin: 0 0 10px; color: #ffddc6; font-size: .9rem; }
  .trial-results { border-top: 1px solid #547461; margin-top: 17px; padding-top: 13px; }
  .trial-results p { color: #e4efdf; font-size: .9rem; margin-bottom: 8px; }
  .rewrite { width: 100%; text-align: left; color: #fff; background: #234a37; border: 1px solid #668877; border-radius: 9px; padding: 8px 10px; margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
  .rewrite:hover { background: #315a45; }
  .rewrite strong { color: var(--lime); }
  #locked { margin-top: 14px; }
  #locked .hint { margin: 0 0 12px; }
  .footer { border-top: 1px solid var(--edge); color: var(--muted); font-size: .875rem; padding: 18px 0 22px; }
  .service-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
  #payment-message:not(:empty) { padding: 10px; border-left: 3px solid var(--green); background: var(--mint); }
  .catalog { padding-bottom: 36px; }
  .catalog h2 { font: 500 1.65rem/1.2 var(--serif); margin-bottom: 12px; }
  .catalog-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0; list-style: none; }
  .toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 9px 16px; border-radius: 9px; color: white; background: #1a3728; z-index: 1; }
  .toast:empty { display: none; }
  dialog { width: min(470px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: auto; padding: 26px; border: 1px solid var(--edge); border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: 0 20px 70px #11281d44; }
  dialog::backdrop { background: #14271ec0; }
  .dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
  .icon-button { padding: 1px 9px 4px; font-size: 1.4rem; line-height: 1.2; }
  dialog h2 { margin-bottom: 11px; }
  dialog p, dialog li { color: var(--muted); }
  dialog ul { padding-left: 1.25rem; margin: 15px 0; }
  #dialog-plans { border:0; padding:0; margin:0 0 12px; }
  #dialog-plans legend { font-weight:600; margin-bottom:4px; }
  #dialog-plans label { display:flex; gap:9px; align-items:center; padding:8px 10px; border-radius:8px; cursor:pointer; }
  #dialog-plans label:has(:checked) { background:var(--mint); }
  #dialog-plans input { width:auto; margin:0; }
  #dialog-plans small { display:block; margin-top:3px; }
  .dialog-note { font-size:.875rem; }
  .dialog-note { margin-top: 9px; }
  @media (max-width: 790px) {
    .wrap { width: min(620px, calc(100% - 36px)); }
    .layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .hero { padding-block: 34px 25px; }
    .top .wrap { min-height: 64px; }
    .trial-jump { display: inline-block; margin-top: 12px; }
  }
  @media (max-width: 520px) {
    .top .wrap { flex-wrap: wrap; padding-block: 12px; gap: 10px; }
    .top nav { flex: 1 1 100%; flex-wrap: wrap; }
    .top-button { margin-inline-start: auto; }
  }
  @media (max-width: 410px) {
    .result, .trial { padding: 20px; }
    .search .button { padding-inline: 12px; }
    .search input { padding-inline: 7px; }
  }
  #synonym-ratings { margin-block: 16px; }
  #synonym-ratings summary { cursor:pointer; font-weight:650; }
  #synonym-ratings label { display:block; margin:10px 0; }
  #synonym-ratings table { width:100%; border-collapse:collapse; }
  .ratings-scroll { overflow-x: auto; }
  #synonym-ratings th, #synonym-ratings td { text-align:left; padding:5px 2px; border-bottom:1px solid #dfe6dc; }
  .rating-vote { border:1px solid #b6c6b5; border-radius:5px; padding:4px 7px; margin:2px; background:white; }
  .rating-vote[aria-pressed="true"] { background:#244e37; color:white; }
#word-inflections select{max-width:100%}
#inflection-words{padding-inline-start:1.3rem}#inflection-words li{margin:.4rem 0}
  #synonym-list .list-options, #synonym-list .list-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin:12px 0; }
  #synonym-list select { font:inherit; max-width:100%; }
  #synonym-list .list-options label { min-width:0; }
  #list-text { width:100%; box-sizing:border-box; font:inherit; padding:8px; }
  #synonym-printout { display:none; }
  @media print {
    body.printing-synonyms > :not(#synonym-printout) { display:none !important; }
    body.printing-synonyms > #synonym-printout { display:block; background:white; color:black; }
    #synonym-printout p { white-space:pre-wrap; overflow-wrap:anywhere; }
  }
