/* Exact ExtraTools tables/zip-rar presentation primitives, adapted for Crossword. */
body.crossword-tool {
    color-scheme: light;
    --canvas: #f4f5f0;
    --paper: #fff;
    --ink: #20251f;
    --muted: #737b72;
    --line: #e5e9e1;
    --green: #367251;
    --green-dark: #254c37;
    --green-pale: #eaf2e9;
    --orange: #bd7848;
    --error: #a54838;
    --shadow: 0 16px 48px rgb(33 48 36 / 5%);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.crossword-tool { min-width: 320px; margin: 0; background: var(--canvas); color: var(--ink); }
:where(body.crossword-tool) select { font: inherit; }
:where(body.crossword-tool) input:focus-visible { outline: 3px solid rgb(var(--green-rgb) / 27%); outline-offset: 2px; }
:where(body.crossword-tool) select:focus-visible { outline: 3px solid rgb(var(--green-rgb) / 27%); outline-offset: 2px; }
:where(body.crossword-tool) [tabindex="0"]:focus-visible { outline: 3px solid rgb(var(--green-rgb) / 27%); outline-offset: 2px; }
:where(body.crossword-tool) .app-shell { width: min(1080px, calc(100% - 48px)); margin: 0 auto; }
:where(body.crossword-tool) .topbar { display: flex; height: 72px; align-items: center; justify-content: space-between; border-bottom: 1px solid #e4e8df; }
:where(body.crossword-tool) .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 16.33333px; font-weight: 800; letter-spacing: -.6px; text-decoration: none; }
:where(body.crossword-tool) .brand-mark { display: flex; width: 21px; height: 21px; align-items: end; gap: 2px; padding: 4px; border-radius: 7px; background: var(--green); }
:where(body.crossword-tool) .brand-mark span { width: 3px; border-radius: 2px; background: #fff; }
:where(body.crossword-tool) .brand-mark span:nth-child(1) { height: 6px; }
:where(body.crossword-tool) .brand-mark span:nth-child(2) { height: 11px; }
:where(body.crossword-tool) .brand-mark span:nth-child(3) { height: 8px; }
:where(body.crossword-tool) .local-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fafbf8; color: #5e685f; font-size: 12.33333px; font-weight: 600; }
:where(body.crossword-tool) .local-badge > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green-bright); }
:where(body.crossword-tool) .hero { max-width: 820px; padding: 48px 0 12px; }
:where(body.crossword-tool) .eyebrow { margin: 0; color: var(--green); font-size: 11.33333px; font-weight: 700; letter-spacing: 1.3px; }
:where(body.crossword-tool) .section-label { margin: 0; color: var(--green); font-size: 11.33333px; font-weight: 700; letter-spacing: 1.3px; }
:where(body.crossword-tool) .hero h1 { margin: 12px 0; font-size: clamp(39.33333px, calc(5vw + 1.33333px), 56.33333px); line-height: 1.08; letter-spacing: -2.5px; }
:where(body.crossword-tool) .hero h1 span { color: var(--green); }
:where(body.crossword-tool) .hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 18px; }:where(body.crossword-tool) .utility-button { display: inline-flex; align-items: center; justify-content: center; }
:where(body.crossword-tool) .mode-note { color: var(--muted); font-size: 11.33333px; line-height: 1.45; }
:where(body.crossword-tool) .tool-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--shadow); }
:where(body.crossword-tool) .card-topline { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.crossword-tool) .progress-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.crossword-tool) .contents-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.crossword-tool) .section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.crossword-tool) .editor-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; }
:where(body.crossword-tool) .card-index { color: #737b72; font-size: 10.33333px; font-weight: 700; letter-spacing: 1px; }
:where(body.crossword-tool) .card-meta { color: #7a8379; font-size: 11.33333px; line-height: 1.5; }
:where(body.crossword-tool) .panel-note { color: #7a8379; font-size: 11.33333px; line-height: 1.5; }
:where(body.crossword-tool) .tool-card h2 { margin: 12px 0 16px; font-size: 20.33333px; letter-spacing: -.5px; }
:where(body.crossword-tool) .settings-panel h3 { margin: 4px 0 0; color: #39473c; font-size: 15.33333px; }
:where(body.crossword-tool) .editor-panel h3 { margin: 4px 0 0; color: #39473c; font-size: 15.33333px; }
:where(body.crossword-tool) .export-panel h3 { margin: 4px 0 0; color: #39473c; font-size: 15.33333px; }
:where(body.crossword-tool) .section-heading h3 { margin: 4px 0 0; color: #39473c; font-size: 15.33333px; }
:where(body.crossword-tool) .settings-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(125px, .8fr) minmax(125px, .8fr) minmax(190px, 1.3fr); align-items: end; gap: 12px; margin-top: 15px; }
:where(body.crossword-tool) .field { display: grid; min-width: 0; gap: 6px; color: #39473c; font-size: 11.33333px; font-weight: 650; }
:where(body.crossword-tool) .field input { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid #e4e9e2; border-radius: 8px; background: #fff; color: var(--ink); font-size: 12.33333px; }
:where(body.crossword-tool) .field select { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid #e4e9e2; border-radius: 8px; background: #fff; color: var(--ink); font-size: 12.33333px; }
:where(body.crossword-tool) .field input:focus-visible { border-color: var(--green-border-strong); }
:where(body.crossword-tool) .field select:focus-visible { border-color: var(--green-border-strong); }
:where(body.crossword-tool) .field--wide { grid-column: span 1; }
:where(body.crossword-tool) .column-types-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
:where(body.crossword-tool) .action-status { margin: 12px 0 0; color: #6c776d; font-size: 11.33333px; line-height: 1.5; }
:where(body.crossword-tool) .error-status { margin: 9px 0 0; padding: 10px 11px; border: 1px solid #eed9d5; border-radius: 8px; background: #fff8f6; color: var(--error); font-size: 12.33333px; line-height: 1.5; }
:where(body.crossword-tool) .result-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 13px; padding: 14px; border: 1px solid #dce8dc; border-radius: 9px; background: #f7faf6; }
:where(body.crossword-tool) .result-panel > div { display: grid; gap: 4px; min-width: 0; }
:where(body.crossword-tool) .result-panel strong { overflow-wrap: anywhere; color: var(--green-dark); font-size: 13.33333px; }
:where(body.crossword-tool) .result-panel span { color: #6e786e; font-size: 11.33333px; }
:where(body.crossword-tool) .footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 38px; padding: 17px 0 24px; border-top: 1px solid #e4e8df; color: #7a8379; font-size: 11.33333px; }
:where(body.crossword-tool) .utility-dialog { width: min(610px, calc(100% - 30px)); max-height: min(80vh, 760px); padding: 22px; overflow: auto; border: 1px solid #dfe7de; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 24px 90px rgb(18 33 24 / 22%); }
:where(body.crossword-tool) .utility-dialog::backdrop { background: rgb(21 30 23 / 48%); }
:where(body.crossword-tool) .utility-dialog h2 { margin: 9px 0 12px; color: #2d3c31; font-size: 20.33333px; }
:where(body.crossword-tool) .utility-dialog ul { padding-left: 20px; color: #566157; font-size: 13.33333px; line-height: 1.7; }
:where(body.crossword-tool) .utility-dialog li { margin: 7px 0; }
:where(body.crossword-tool) .dialog-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }:where(body.crossword-tool) .dialog-close { display: grid; width: 32px; height: 32px; place-items: center; }
:where(body.crossword-tool) .dialog-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #edf0eb; color: var(--muted); font-size: 11.33333px; line-height: 1.6; }
:where(body.crossword-tool) .utility-dialog--error { border-top: 4px solid var(--error); }
:where(body.crossword-tool) #error-dialog-message { color: #586157; font-size: 13.33333px; line-height: 1.65; }
:where(body.crossword-tool) .tool-brand-header {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-between;
    gap: 0 .75rem;
    height: auto;
    min-height: 72px;
    padding-block: .45rem;
}
:where(body.crossword-tool) .tool-brand-tagline {
    flex: 0 0 100%;
    order: 10;
    width: 100%;
    margin: .15rem 0 0;
    color: #68756b;
    font-size: 0.78333rem;
    font-weight: 700;
    letter-spacing: .09em;
    line-height: 1.4;
    text-transform: uppercase;
}
:where(body.crossword-tool) .tool-breadcrumbs {
    display: block;
    width: 100%;
    margin: 0 0 clamp(12px, 1.7vw, 20px);
    color: #68756b;
    font: inherit;
    font-size: 0.88333rem;
    line-height: 1.5;
}
:where(body.crossword-tool) .tool-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
:where(body.crossword-tool) .tool-breadcrumbs li + li::before {
    content: "/";
    margin-right: .35rem;
    color: #9aa59b;
}
:where(body.crossword-tool) .tool-breadcrumbs ol a {
    display: inline-flex;
    min-height: 31px;
    align-items: center;
    padding: .28rem .78rem;
    border: 1px solid var(--green-border);
    border-radius: 999px;
    background: var(--green-pale);
    box-shadow: 0 1px 2px rgb(37 76 55 / 8%);
    color: var(--green-dark);
    font-weight: 750;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
:where(body.crossword-tool) .tool-breadcrumbs ol a:hover {
    border-color: var(--green);
    background: var(--green-pale-hover);
    color: var(--green-deep);
}
:where(body.crossword-tool) .tool-brand-tagline {
    box-sizing: border-box;
}

/* Crosswords: extends the existing ExtraTools controls and cards (no framework). */
body.crossword-tool {
  --green-rgb:54 114 81; --green-border:#b9d2bd; --green-border-strong:#9ec5a3;
  --green-pale-hover:#deecdc; --green-deep:#254c37; --green-bright:#66a875;
}
body.crossword-tool * { box-sizing:border-box; }
body.crossword-tool .app-shell.is-simple [data-advanced] { display:none!important; }
body.crossword-tool .field textarea,
body.crossword-tool .field select,
body.crossword-tool .field input { width:100%; min-width:0; border:1px solid #e4e9e2; border-radius:8px; background:#fff; color:var(--ink); font:inherit; font-size:13px; }
body.crossword-tool .field textarea { min-height:132px; padding:13px 14px; font-size:14px; line-height:1.7; resize:vertical; }
body.crossword-tool .field select,
body.crossword-tool .field input { min-height:43px; padding:9px 11px; }
body.crossword-tool .word-input { font-size:13px; }
body.crossword-tool .cw-settings { display:grid; grid-template-columns: minmax(200px,1fr) minmax(200px,1.5fr); gap:12px; margin-top:14px; }
body.crossword-tool .cw-generator-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:16px 0 0; }
body.crossword-tool .editor-hint { color:#68756b; font-size:12px; line-height:1.65; }
body.crossword-tool .cw-result-panel,
body.crossword-tool .cw-export-panel,
body.crossword-tool .cw-stats { min-width:0; margin-top:22px; padding:17px; border:1px solid #e6ebe4; border-radius:11px; background:#fcfdfa; }
body.crossword-tool .section-heading h3 { margin:4px 0 0; color:#39473c; font-size:16px; }
body.crossword-tool .cw-view-tabs { display:flex; align-items:center; flex-wrap:wrap; gap:9px; margin:18px 0 6px; }
body.crossword-tool .cw-view-tabs button[aria-pressed="false"] { box-shadow:none; }
body.crossword-tool .cw-board-scroll { min-width:0; width:100%; overflow-x:auto; overflow-y:hidden; overscroll-behavior-inline:contain; padding:16px max(12px, 1vw) 21px; margin:15px 0 11px; border:1px solid #dfe8dc; border-radius:10px; background:#f2f6ef; scrollbar-gutter:stable; }
body.crossword-tool .cw-grid { --cell-size:clamp(29px,3.4vw,42px); display:grid; grid-template-columns:repeat(var(--cw-cols), var(--cell-size)); grid-auto-rows:var(--cell-size); width:max-content; margin-inline:auto; border:1px solid #354339; background:#354339; }
body.crossword-tool .cw-cell { position:relative; display:grid; place-items:center; min-width:0; min-height:0; border:1px solid #455247; background:#fff; color:#273b2f; line-height:1; }
body.crossword-tool .cw-cell--block { background:#29352c; border-color:#29352c; }
body.crossword-tool .cw-cell-number { position:absolute; inset-block-start:2px; inset-inline-start:3px; font-size:clamp(7px, .85vw, 9px); color:#516151; line-height:1; font-weight:800; pointer-events:none; }
body.crossword-tool .cw-cell-letter { font-size:clamp(15px,1.6vw,21px); font-weight:750; text-transform:uppercase; }
body.crossword-tool .cw-cell-input { display:block; width:100%; height:100%; margin:0!important; padding:8px 2px 1px!important; border:0!important; border-radius:0!important; background:transparent!important; color:#284c35!important; text-align:center; font:750 clamp(15px,1.6vw,21px)/1 'Segoe UI',Arial,sans-serif!important; text-transform:uppercase; caret-color:var(--green); }
body.crossword-tool .cw-cell:focus-within { z-index:1; outline:2px solid var(--green); outline-offset:-1px; background:#edf7e9; }
body.crossword-tool .cw-cell--correct { background:#e9f6e7; }
body.crossword-tool .cw-cell--wrong { background:#fff1ec; }
body.crossword-tool .cw-cell--wrong .cw-cell-input { color:#af473b!important; }
body.crossword-tool .cw-cell--active { background:#f5faec; }
body.crossword-tool .cw-inline-actions { display:flex; gap:9px; flex-wrap:wrap; margin:7px 0 4px; }
body.crossword-tool .cw-clues { margin-top:19px; border-top:1px solid #e3e9df; padding-top:17px; }
body.crossword-tool .cw-clue-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:23px; margin-top:11px; }
body.crossword-tool .cw-clue-columns h4 { margin:9px 0; color:#3c5843; font-size:13px; }
body.crossword-tool .cw-clue-list { display:grid; gap:8px; align-content:start; }
body.crossword-tool .cw-clue-row { display:grid; grid-template-columns:47px minmax(0,1fr); gap:8px; align-items:center; }
body.crossword-tool .cw-clue-index { color:var(--green-dark); font-size:12px; font-weight:800; }
body.crossword-tool .cw-clue-row input { width:100%; min-width:0; height:38px; padding:8px 10px; border:1px solid #e4e9e2; border-radius:7px; background:#fff; color:var(--ink); font:12px 'Segoe UI',sans-serif; }
body.crossword-tool .cw-export-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:14px 0 8px; }
body.crossword-tool .cw-stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:15px; }
body.crossword-tool .cw-stat { display:flex; flex-direction:column; gap:3px; align-items:center; padding:13px 8px; border:1px solid #dae8d9; border-radius:9px; background:#fff; }
body.crossword-tool .cw-stat strong { color:var(--green-dark); font-size:clamp(19px,2.8vw,28px); line-height:1.2; font-variant-numeric:tabular-nums; }
body.crossword-tool .cw-stat span { color:#657366; font-size:12px; text-align:center; }
body.crossword-tool .cw-unused { margin-top:14px; }
body.crossword-tool .cw-unused summary { color:var(--green-dark); font-size:12px; font-weight:700; cursor:pointer; }
body.crossword-tool .cw-unused p { padding:8px 0; color:#617061; overflow-wrap:anywhere; font-size:12px; line-height:1.7; }
body.crossword-tool .visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; clip-path:inset(50%); }
body.crossword-tool button:disabled { opacity:.5; cursor:not-allowed; }
body.crossword-tool :where(button,input,textarea,select,a):focus-visible { outline:3px solid rgb(54 114 81 / 28%); outline-offset:2px; }
body.crossword-tool dialog.utility-dialog { position:fixed; z-index:2147483647; }
body.crossword-tool .error-status { margin-top:13px; }
body.crossword-tool .action-status { margin-top:14px; }
body.crossword-tool .seo-details { margin:36px 0 0; padding:22px 0 0; border-top:1px solid var(--line); color:#5c6a5f; line-height:1.8; }
body.crossword-tool .seo-details h2 { color:#2c3b30; font-size:clamp(18px,2.4vw,24px); line-height:1.3; }
body.crossword-tool .seo-details ul { padding-left:22px; }
body.crossword-tool .seo-details li { margin:6px 0; }
body.crossword-tool #crossword-result[hidden],body.crossword-tool [hidden] { display:none!important; }
body.crossword-tool .utility-dialog .dialog-topline { margin-bottom:11px; }
@media (max-width:720px) {
 body.crossword-tool .cw-settings { grid-template-columns:1fr; }
 body.crossword-tool .cw-clue-columns { grid-template-columns:1fr; gap:10px; }
 body.crossword-tool .cw-board-scroll { padding-inline:8px; }
 body.crossword-tool .cw-export-actions>button { flex:1 1 145px; }
}
@media (max-width:600px) {
 body.crossword-tool .app-shell { width:calc(100% - 24px); }
 body.crossword-tool .hero { padding-top:28px; }
 body.crossword-tool .tool-card { padding:14px; }
 body.crossword-tool .cw-result-panel,body.crossword-tool .cw-export-panel,body.crossword-tool .cw-stats { padding:12px; }
 body.crossword-tool .footer { flex-wrap:wrap; }
 body.crossword-tool .cw-grid { --cell-size:32px; }
 body.crossword-tool .cw-cell-number { font-size:8px; }
}
@media (max-width:360px) {
 body.crossword-tool .cw-generator-actions > button { flex:1 1 120px; }
 body.crossword-tool .cw-stat { padding:10px 5px; }
 body.crossword-tool .cw-stat span { font-size:10px; }
}

/* Crossword intersection constraints and re-layout controls. */
body.crossword-tool .cw-intersection-settings { grid-column:1/-1; min-width:0; margin:0; padding:12px 14px 10px; border:1px solid var(--line); border-radius:9px; background:#f8fbf7; }
body.crossword-tool .cw-intersection-settings legend { padding:0 5px; color:#39473c; font-size:13px; font-weight:700; }
body.crossword-tool .cw-intersection-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
body.crossword-tool #intersection-hint { margin:9px 0 0; }
body.crossword-tool .cw-result-heading-actions { display:flex; gap:10px; align-items:center; justify-content:flex-end; flex-wrap:wrap; min-width:0; }
body.crossword-tool .cw-rebuild-button { flex-shrink:0; }
body.crossword-tool #intersection-summary { margin:10px 0 0; }
body.crossword-tool #notice-dialog-message { color:#566157; font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
@media (max-width:600px) {
 body.crossword-tool .cw-result-heading-actions { justify-content:flex-start; }
 body.crossword-tool .cw-intersection-settings { padding:10px; }
}
@media (max-width:370px) {
 body.crossword-tool .cw-intersection-fields { grid-template-columns:1fr; }
}

/* Manual crossword constructor: existing ExtraTools card, field and button primitives. */
body.crossword-tool .cw-template-panel {
  min-width:0; margin-top:20px; padding:17px;
  border:1px solid #e6ebe4; border-radius:11px; background:#fcfdfa;
}
body.crossword-tool .cw-template-panel .section-heading { margin-bottom:10px; }
body.crossword-tool .cw-template-panel .editor-hint { margin:6px 0 12px; }
body.crossword-tool .cw-template-fields {
  display:grid; grid-template-columns:minmax(200px, 2fr) minmax(95px,.7fr) minmax(95px,.7fr) auto;
  align-items:end; gap:12px;
}
body.crossword-tool .cw-template-fields > * { min-width:0; }
body.crossword-tool .cw-template-fields > button { min-height:43px; margin:0; white-space:normal; }
body.crossword-tool .cw-template-fields input:disabled { opacity:.6; background:#eff2ed; }
body.crossword-tool .cw-manual-tools {
  display:flex; flex-direction:column; align-items:flex-start; gap:9px;
  margin-top:12px; padding:12px 14px; border:1px solid #dce6d9;
  background:#f5f9f3; border-radius:9px;
}
body.crossword-tool .cw-manual-tools[hidden] { display:none!important; }
body.crossword-tool .cw-manual-segment { display:flex; flex-wrap:wrap; gap:9px; }
body.crossword-tool .cw-manual-tools .editor-hint { margin:0; }
body.crossword-tool .cw-cell-toggle {
  appearance:none; -webkit-appearance:none;
  position:absolute; inset:0; width:100%; height:100%;
  display:block; border:0!important; border-radius:0!important; padding:0!important; margin:0!important;
  background:transparent!important; color:inherit; cursor:pointer;
}
body.crossword-tool .cw-cell:has(> .cw-cell-toggle):hover { outline:2px solid var(--green); outline-offset:-2px; z-index:1; }
body.crossword-tool .cw-cell .cw-cell-toggle:focus-visible { outline:3px solid var(--green); outline-offset:-3px; z-index:2; }
body.crossword-tool .cw-cell-number { z-index:3; }
@media(max-width:860px){
  body.crossword-tool .cw-template-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.crossword-tool .cw-template-fields > .field:first-child { grid-column:1/-1; }
  body.crossword-tool .cw-template-fields > button { grid-column:1/-1; width:100%; }
}
@media(max-width:600px){
  body.crossword-tool .cw-template-panel { padding:12px; }
  body.crossword-tool .cw-manual-tools { padding:10px; }
  body.crossword-tool .cw-manual-segment { width:100%; }
  body.crossword-tool .cw-manual-segment > button { flex:1 1 130px; }
}

/* Creation modes share the site's existing primary and secondary buttons. */
body.crossword-tool .cw-creation-tabs { display:flex; flex-wrap:wrap; gap:10px; margin:0 0 20px; }
body.crossword-tool .cw-template-panel { margin-top:0; }
body.crossword-tool .cw-export-panel > .field { max-width:36rem; }
@media(max-width:600px) {
  body.crossword-tool .cw-creation-tabs > button { flex:1 1 130px; }
}
