/* The search form; result cards and the sidebar retain their existing layout. */
:is(.search-page, .home-page) .solver-panel {
  --solver-ink: #171b20; --solver-muted: #747d85;
  --solver-paper: #faf7ef; --solver-grid: rgb(112 99 73 / 10%);
  position: relative; isolation: isolate; z-index: 1;
  padding: 20px; border: 1px solid #e5ddcc; border-radius: 16px !important;
  background-color: var(--solver-paper);
  background-image: linear-gradient(90deg, var(--solver-paper) 20%, transparent 100%),
    linear-gradient(var(--solver-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--solver-grid) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px; background-position: right top;
  color: var(--solver-ink); box-shadow: none;
}
:is(.search-page, .home-page) .solver-panel::before {
  content: ''; position: absolute; z-index: -1; top: 0; right: 0; width: 28px; height: 28px;
  border-top-right-radius: 15px; background: #273c30; opacity: .08; pointer-events: none;
  box-shadow: -28px 0 #273c30, 0 28px #273c30, -84px 56px #273c30, -112px 84px #273c30, -56px 112px #273c30;
}


.solver-panel [hidden] { display: none !important; }
.solver-heading { display: flex; align-items: center; gap: 9px; }
:is(.search-page, .home-page) .solver-panel :is(h1, h2) { margin: 0; font-size: 21px; font-weight: 500; line-height: 1.3; letter-spacing: -.35px; }
.solver-heading h1 span { color: var(--solver-muted); }
.solver-panel .solver-info-toggle { display: inline-grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; margin: 0; padding: 0; border: 1px solid var(--solver-muted) !important; border-radius: 50% !important; background: transparent; color: var(--solver-muted); font: 13px/1 Georgia, serif; cursor: pointer; }
.solver-panel .solver-intro { margin: 10px 0 21px; color: var(--solver-ink); font-size: 15px; line-height: 1.5; }
.solver-panel .solver-help { margin: -8px 0 18px; padding: 10px 12px; background: var(--bg-secondary); color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
:is(.search-page, .home-page) #clue-search-form.solver-form { display: grid; gap: 12px; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.solver-field { min-width: 0; }
.solver-panel .solver-pattern-count { margin: 1px 6px 5px; color: var(--solver-muted); font-size: 13px; line-height: 1.4; }
.solver-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; margin-bottom: 6px; }
.solver-label-row label { margin: 0; color: var(--solver-ink); font-size: 14px; font-weight: 500; line-height: 1.5; }
.solver-panel svg { display: block; width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.solver-panel .solver-mode-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 24px; padding: 0 2px; border: 0 !important; background: transparent; color: var(--solver-muted); font-size: 13px; font-weight: 400; cursor: pointer; }
.solver-panel .solver-mode-toggle:hover, .solver-panel .solver-mode-toggle[aria-pressed="true"] { color: var(--accent-blue); }
:is(.search-page, .home-page) .solver-panel :is(.solver-pattern-input, #clue-query-input) { display: block; width: 100%; max-width: none; margin: 0; padding: 8px 12px; border: 1px solid #d9dfe6 !important; border-radius: 6px !important; background: var(--bg-card); color: var(--solver-ink); font: 15px/1.5 var(--font-sans, system-ui, sans-serif); box-shadow: none; outline: none; }
:is(.search-page, .home-page) .solver-panel .solver-pattern-input { height: 39px; min-height: 39px; letter-spacing: .04em; }
:is(.search-page, .home-page) .solver-panel #clue-query-input { min-height: 62px; resize: vertical; }
:is(.search-page, .home-page) .solver-panel :is(.solver-pattern-input, #clue-query-input):focus { border-color: #8da9cc !important; box-shadow: 0 0 0 3px rgb(37 99 235 / 8%); }
.solver-clue-label { justify-content: flex-start; gap: 10px; }
:is(.search-page, .home-page) .solver-panel #clear-search-input { display: inline-grid; place-items: center; position: static; width: 24px; height: 24px; min-height: 0; padding: 3px; border: 0 !important; background: transparent; color: var(--solver-ink); opacity: 1; cursor: pointer; }
.solver-panel #clear-search-input:hover { color: #b91c1c; }
.solver-query-field { position: relative; }
:is(.search-page, .home-page) .solver-panel #clue-search-suggestions { position: absolute; top: 100%; left: 0; right: 0; width: 100%; max-height: 280px; margin-top: 4px; padding: 0; z-index: 40; overflow-y: auto; border: 1px solid var(--border-normal); border-radius: 6px !important; background: var(--bg-card); box-shadow: 0 10px 24px rgb(15 23 42 / 10%); }
:is(.search-page, .home-page) .solver-panel #clue-search-suggestions .home-solver-suggestion { min-height: 40px; padding: 10px 12px; font-size: 14px; }
.solver-actions { position: relative; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 3px; }
.solver-primary-actions { display: flex; gap: 10px; margin-left: auto; }
.solver-panel .solver-action, .solver-examples summary { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; padding: 8px 12px; border: 1px solid #171b20 !important; border-radius: 6px !important; background: #050505; color: #fff; font: inherit; font-size: 14px; font-weight: 400; line-height: 1.4; text-decoration: none; cursor: pointer; transition: background-color 150ms ease, box-shadow 150ms ease, transform 100ms ease; -webkit-tap-highlight-color: transparent; }
.solver-panel .solver-action:hover { background: #30343a; }
.solver-panel .solver-action:active, .solver-examples summary:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgb(0 0 0 / 20%); }
.solver-examples { position: static; }
.solver-examples summary { list-style: none; border-color: #707980 !important; background: #707980; }
.solver-examples summary::-webkit-details-marker { display: none; }
.solver-examples summary:hover { background: #5d666d; }
.solver-examples summary .solver-chevron { width: 13px; height: 13px; margin-left: 2px; transition: transform 150ms ease; }
.solver-examples[open] summary .solver-chevron { transform: rotate(180deg); }
.solver-examples-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 45; width: 100%; max-width: none; padding: 5px; border: 1px solid var(--border-normal); border-radius: 7px; background: var(--bg-card); box-shadow: 0 10px 24px rgb(15 23 42 / 12%); }
.solver-panel .solver-examples-menu button { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px; border: 0 !important; border-radius: 4px !important; background: transparent; color: var(--solver-ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.solver-examples-menu button span { color: var(--text-secondary); font-size: 12px; }
.solver-examples-menu button strong, .solver-examples-menu button span { max-width: 100%; overflow-wrap: anywhere; }
.solver-panel .solver-history-empty { margin: 0; padding: 10px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.search-community-invite { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: start; gap: 14px; margin-top: 16px; padding: 20px; border: 1px solid var(--border-normal); border-radius: 16px; background: var(--bg-card); }
.search-community-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--accent-blue-soft); color: var(--accent-blue); }
.search-community-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.search-community-invite h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.4; }
.search-community-invite p { margin: 7px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.search-community-link { display: inline-flex; align-items: center; justify-content: center; align-self: center; gap: 8px; min-height: 40px; padding: 9px 13px; border: 1px solid #000; border-radius: 6px; background: #000; color: #fff; font-size: 14px; font-weight: 500; line-height: 1.4; text-decoration: none; transition: background-color 150ms ease; }
.search-community-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search-community-link:hover { background: #222; color: #fff; }
.search-community-link:active { background: #111; }
.search-community-link:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
@media (max-width: 600px) { .search-community-invite { grid-template-columns: 34px minmax(0, 1fr) 40px; padding: 16px; gap: 10px; } .search-community-icon { width: 34px; height: 34px; } .search-community-link { width: 40px; height: 40px; padding: 0; } .search-community-link-label { display: none; } }
.solver-panel .solver-examples-menu button:hover { background: var(--accent-blue-soft); }
.solver-pattern-label { display: flex; align-items: center; gap: 12px; }
.solver-panel .solver-pattern-clear { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 3px; border: 0 !important; background: transparent; color: var(--solver-ink); cursor: pointer; }
.solver-pattern-clear:hover { color: #b91c1c; }
.solver-length-options { display: flex; width: 100%; }
.solver-panel .solver-length-options button { flex: 1 1 0; min-width: 0; min-height: 50px; padding: 8px 3px; border: 0 !important; border-right: 1px solid #30343a !important; border-radius: 0 !important; background: #050505; color: #fff; font: inherit; font-size: 14px; cursor: pointer; transition: background-color 150ms ease; }
.solver-panel .solver-length-options button:first-child { border-radius: 5px 0 0 5px !important; }
.solver-panel .solver-length-options button:last-child { border-right: 0 !important; border-radius: 0 5px 5px 0 !important; }
.solver-panel .solver-length-options .solver-length-edge { background: #707980; border-color: #707980 !important; }
.solver-panel .solver-length-options button:hover { background: #343a40; }
.solver-panel .solver-length-options button:active { background: #4b535b; }
.solver-cells { display: flex; flex-wrap: wrap; width: 100%; max-width: 100%; margin-top: 5px; padding: 1px 0 0 1px; border: 0; overflow: visible; }
.solver-panel input.solver-cell { font-weight: 600; display: block; width: 39px; height: 40px; min-width: 0; padding: 2px; border: 1px solid var(--solver-ink) !important; border-radius: 0 !important; background: var(--bg-card); color: var(--solver-ink); font-size: 16px; text-align: center; text-transform: uppercase; }
.solver-cell-wrap { position: relative; display: block; flex: 0 0 39px; width: 39px; height: 40px; margin: -1px 0 0 -1px; }
.solver-cell-number { position: absolute; top: 2px; left: 3px; z-index: 1; color: var(--solver-ink); font-size: 9px; font-weight: 400; line-height: 1; pointer-events: none; }
.solver-panel .solver-cell-wrap input.solver-cell { height: 40px; padding-top: 8px; }
.solver-panel input.solver-cell::placeholder { color: var(--solver-ink); opacity: 1; }
.solver-panel input.solver-cell:focus-visible { outline-offset: -3px; }
.solver-panel .solver-action:disabled { border-color: #dedede !important; background: #dedede; color: #999; cursor: default; transform: none; box-shadow: none; }
.solver-panel :is(button, summary, .solver-cell):focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 3px; }


@media (max-width: 600px) { :is(.search-page, .home-page) .solver-panel { padding: 16px; } :is(.search-page, .home-page) .solver-panel :is(.solver-pattern-input, #clue-query-input) { font-size: 16px; } }
@media (max-width: 380px) { .solver-examples { width: 100%; } .solver-primary-actions { width: 100%; } .solver-primary-actions .solver-action { flex: 1; } }
@media (prefers-reduced-motion: reduce) { .solver-panel :is(button, summary, svg) { transition: none; } .solver-panel .solver-action:active, .solver-examples summary:active { transform: none; } }

.home-page .solver-panel { margin-bottom: 20px; }
