    :root {
      --correct-color: rgb(83, 141, 78);
      --wrong-spot-color: rgb(181, 159, 59);
      --incorrect-color: rgb(58, 58, 60);
      --off-white: #FCF7F8;
      --background: #191919;
      --text-color: white;
      --bar-color: #3891A6;
      --gray-color: #424242;
    }

    html, body {
      font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
      overflow-x: hidden;
      margin: 0;
      padding: 0;
      color: var(--text-color);
    }

    body {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      background: var(--background);
      min-height: 100vh;
    }

    #layout {
      display: flex;
      align-items: flex-start;
      justify-content: center;
      gap: 1rem;
      width: 100%;
      max-width: 800px;
      padding: 0 0.5rem;
      box-sizing: border-box;
    }

    #container {
      width: min(500px, 100%);
      flex-shrink: 0;
      padding: 0 0.5rem 2rem;
      box-sizing: border-box;
      position: relative;
    }

    /* ── Analysis sidebar ── */
    #analysis-panel {
      width: 175px;
      flex-shrink: 0;
      padding: 0.6rem 0.7rem 0.8rem;
      background: rgb(39, 39, 39);
      border: solid 2px var(--gray-color);
      box-sizing: border-box;
      position: sticky;
      top: 0.5rem;
      font-size: 0.78rem;
    }

    /* Hide sidebar on narrow screens */
    @media (max-width: 720px) {
      #analysis-panel { display: none; }
    }

    .ap-heading {
      font-size: 0.8rem;
      font-weight: bold;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--bar-color);
      border-bottom: 1px solid var(--gray-color);
      padding-bottom: 0.3rem;
      margin-bottom: 0.5rem;
    }

    .ap-section { margin-bottom: 0.75rem; }

    .ap-subheading {
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #888;
      margin-bottom: 0.25rem;
    }

    .ap-meta {
      font-size: 0.65rem;
      color: #666;
      margin-bottom: 0.2rem;
    }

    .ap-list {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    .ap-list li {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      padding: 0.2rem 0.3rem;
      border-radius: 2px;
      cursor: pointer;
      gap: 0.3rem;
    }

    .ap-list li:hover { background: #333; }

    .ap-guess {
      font-family: Verdana, Geneva, Tahoma, sans-serif;
      font-weight: bold;
      font-size: 0.75rem;
      letter-spacing: 0.04em;
    }

    .ap-guess .wov { color: var(--bar-color); }

    .ap-score {
      font-size: 0.68rem;
      color: rgb(101, 189, 94);
      white-space: nowrap;
      flex-shrink: 0;
    }

    .ap-disclaimer {
      margin: 0.5rem 0 0;
      font-size: 0.63rem;
      color: #666;
      line-height: 1.4;
    }

    /* ── Header ── */
    #top-of-screen {
      font-variant-caps: small-caps;
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      margin: 0.5rem 0;
      border-bottom: solid 1px var(--gray-color);
      padding-bottom: 0.5rem;
    }

    #top-of-screen h1 {
      margin: 0;
      padding: 0;
      font-size: 1.75rem;
    }

    .header-button {
      position: absolute;
      z-index: 100;
      font-size: 1.25rem;
      padding: 0;
      bottom: 0.1rem;
      background: transparent;
      border: none;
      color: var(--text-color);
      cursor: pointer;
      display: flex;
      align-items: center;
    }

    .header-button.info { left: 0.5rem; }
    .header-button.reset-all { right: 0.5rem; }

    button { cursor: pointer; }
    button:hover { filter: brightness(90%); }

    /* ── Info screen ── */
    .screen {
      width: min(500px, 95%);
      position: absolute;
      overflow-y: auto;
      text-align: center;
      background: var(--off-white);
      box-shadow: var(--gray-color) 0 0 0 1px;
      z-index: 200;
      left: 0; right: 0;
      margin-left: auto;
      margin-right: auto;
      display: none;           /* hidden until toggled */
      align-items: center;
      flex-direction: column;
      padding: 0 1rem 1.5rem;
      box-sizing: border-box;
      max-height: 80vh;
      color: var(--background);
      top: 0;
    }

    .screen.open { display: flex; }

    .close {
      align-self: flex-start;
      background: transparent;
      border: none;
      font-size: 1.25rem;
      color: var(--background);
      padding: 0.4rem 0;
      margin-top: 0.2rem;
    }

    .close::after { content: "\2716"; display: inline-block; }

    .mini-header {
      font-size: 1.4rem;
      border-bottom: solid 1px black;
      width: 90%;
      text-align: center;
      margin-top: 1rem;
    }

    .description {
      font-size: 0.85rem;
      color: #555;
      margin-top: 0.1rem;
    }

    .example-row {
      display: flex;
      gap: 3px;
      justify-content: center;
      margin: 0.4rem 0;
    }

    .ex-tile {
      width: 2.4rem;
      height: 2.4rem;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 1.1rem;
      font-weight: bold;
      box-sizing: border-box;
      color: white;
    }

    .ex-tile.G  { background: var(--correct-color); }
    .ex-tile.Y  { background: var(--wrong-spot-color); }
    .ex-tile.B  { background: var(--incorrect-color); }
    .ex-tile.X  { border: solid 1px #999; color: var(--background); }
    .ex-tile.ov { border: solid 2px var(--bar-color); color: var(--background); }

    /* ── Status bar ── */
    #status-bar {
      font-size: 0.75rem;
      color: #888;
      text-align: center;
      min-height: 1.1rem;
      margin: 0.2rem 0;
    }

    /* ── Inputs ── */
    .input-section {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      width: 100%;
      margin-top: 0.6rem;
    }

    .section-label {
      font-size: 0.72rem;
      color: #aaa;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 0.2rem;
    }

    .worwordle-input {
      background-color: transparent;
      caret-color: white;
      border: none;
      border-bottom: solid 2px var(--correct-color);
      color: var(--text-color);
      height: 2rem;
      font-size: 1.2rem;
      width: min(95%, 16rem);
      text-align: center;
      padding: 0;
      font-weight: bold;
      text-transform: uppercase;
      letter-spacing: 0.15em;
    }

    .worwordle-input::placeholder { color: #666; font-weight: normal; text-transform: none; letter-spacing: 0; }
    .worwordle-input:focus { outline: none; }

    /* ── Button row ── */
    .button-row {
      display: flex;
      gap: 0.5rem;
      justify-content: center;
      align-items: center;
      margin: 0.6rem 0 0.3rem;
      flex-wrap: wrap;
    }

    .action-btn {
      background: var(--bar-color);
      border: none;
      color: white;
      font-size: 0.95rem;
      font-weight: bold;
      padding: 0.55rem 1.2rem;
      border-radius: 2px;
      font-family: inherit;
    }

    .action-btn.secondary { background: var(--gray-color); }

    /* ── Undo / Recalculate arrow buttons ── */
    #next-previous-buttons {
      display: flex;
      justify-content: center;
      gap: 1rem;
      margin-top: 0.5rem;
    }

    #next-previous-buttons button {
      text-decoration: underline;
      font-size: 0.95rem;
      position: relative;
      height: 3rem;
      padding: 0 2rem;
      background: transparent;
      border: none;
      color: var(--text-color);
      font-family: inherit;
    }

    #next-previous-buttons button:disabled {
      opacity: 0.35;
      cursor: default;
      filter: none;
    }

    /* arrow line + triangle — Recalculate only */
    .calc-btn::after {
      content: "";
      height: 7%;
      width: 20%;
      background: var(--text-color);
      position: absolute;
      bottom: 0;
      right: 6%;
    }

    .calc-btn::before {
      content: "";
      width: 0;
      height: 0;
      background: transparent;
      position: absolute;
      bottom: -12%;
      right: 5%;
      border-top: solid 0.5em transparent;
      border-bottom: solid 0.5em transparent;
      border-left: solid 0.5em var(--text-color);
    }

    /* ── Guess grid ── */
    #guess-grid {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-top: 0.4rem;
      gap: 4px;
    }

    .guess-row-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 100%;
    }

    .word-markers {
      display: flex;
      width: min(460px, 100%);
      font-size: 0.58rem;
      color: #888;
      letter-spacing: 0.04em;
      margin-bottom: 1px;
      user-select: none;
    }

    /* Each tile is ~3.5rem wide + 2px gap. 8 tiles + separator = layout below */
    .wm-word1 { width: calc(3 * 3.5rem + 3 * 2px); text-align: center; flex-shrink: 0; }
    .wm-overlap { width: calc(2 * 3.5rem + 2 * 2px + 4px); text-align: center; flex-shrink: 0; color: var(--bar-color); font-weight: bold; }
    .wm-word2 { width: calc(3 * 3.5rem + 3 * 2px); text-align: center; flex-shrink: 0; }

    .guess-row {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 2px;
    }

    .tile {
      width: 3.5rem;
      height: 3.5rem;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 1.4rem;
      font-weight: bold;
      box-sizing: border-box;
      flex-shrink: 0;
      user-select: none;
    }

    .tile.G  { background: var(--correct-color); border: 2px solid var(--correct-color); }
    .tile.Y  { background: var(--wrong-spot-color); border: 2px solid var(--wrong-spot-color); }
    .tile.B  { background: var(--incorrect-color); border: 2px solid var(--incorrect-color); }
    .tile.X  { background: transparent; border: solid 2px var(--gray-color); }
    /* overlap blue top border overrides — keep it visible on colored tiles too */
    .tile.overlap.X  { border-top: 3px solid var(--bar-color); }
    .tile.overlap.G  { border-top: 3px solid var(--bar-color); }
    .tile.overlap.Y  { border-top: 3px solid var(--bar-color); }
    .tile.overlap.B  { border-top: 3px solid var(--bar-color); }
    .tile.clickable  { cursor: pointer; transition: filter 0.1s; }
    .tile.clickable:hover { filter: brightness(75%); }

    .word-sep {
      width: 4px;
      height: 3.5rem;
      background: var(--bar-color);
      opacity: 0.45;
      flex-shrink: 0;
    }

    /* ── Suggestions ── */
    #suggestions {
      position: relative;
      text-align: center;
      width: 100%;
      margin-top: 0.8rem;
      border: solid 2px var(--gray-color);
      padding: 0.8rem 0 0.5rem;
      background-color: rgb(39, 39, 39);
      box-sizing: border-box;
    }

    .possibilities-count {
      text-align: center;
      margin: 0 0 0.3rem;
      font-size: 0.95rem;
    }

    .possibilities-count em { font-style: normal; font-weight: bold; color: var(--bar-color); }

    h3.mini-title {
      font-size: 0.95rem;
      text-align: center;
      margin: 0.2rem 0 0.5rem;
      font-weight: normal;
      color: #bbb;
    }

    #best-guesses-list {
      list-style: none;
      margin: 0;
      padding: 0;
      width: 100%;
    }

    .guess-item {
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      min-height: 2.1rem;
      padding: 0.3rem 4.5rem 0.3rem 1rem;
      border-bottom: solid 1px #2e2e2e;
      box-sizing: border-box;
      cursor: pointer;
    }
    .guess-item:hover { background: #2a2a2a; }

    .guess-item:first-child { border-top: solid 1px #2e2e2e; }

    .guess-word {
      font-family: Verdana, Geneva, Tahoma, sans-serif;
      font-size: 1rem;
      font-weight: bold;
      letter-spacing: 0.06em;
    }

    .w1   { color: var(--off-white); }
    .wov  { color: var(--bar-color); }
    .w2   { color: var(--off-white); }

    .guess-item.is-answer .guess-word { text-decoration: underline; text-underline-offset: 2px; }

    .guess-score {
      position: absolute;
      right: 0.75rem;
      font-family: Verdana, Geneva, Tahoma, sans-serif;
      font-weight: bold;
      color: rgb(101, 189, 94);
      font-size: 0.85rem;
      white-space: nowrap;
    }

    .no-results {
      padding: 1rem;
      color: #888;
      font-style: italic;
    }

    /* ── Toggles ── */
    #toggle-row {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 0.6rem;
      margin-bottom: 0.4rem;
      flex-wrap: wrap;
      row-gap: 0.5rem;
    }

    .toggle-divider {
      width: 1px;
      height: 1.2rem;
      background: var(--gray-color);
      margin: 0 0.25rem;
    }

    .toggle-group {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      white-space: nowrap;
    }

    .toggle-label {
      font-size: 0.85rem;
      color: #bbb;
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 2.4rem;
      height: 1.375rem;
      flex-shrink: 0;
    }

    .switch input { opacity: 0; width: 0; height: 0; }

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0; left: 0; right: 0; bottom: 0;
      background-color: #555;
      transition: .2s;
    }

    .slider:before {
      position: absolute;
      content: "";
      height: 76.5%;
      aspect-ratio: 1;
      left: 6.67%;
      bottom: 13%;
      background-color: white;
      transition: .2s;
    }

    input:checked + .slider { background-color: var(--correct-color); }
    input:checked + .slider:before { transform: translateX(100%); }
    .slider.round { border-radius: 100vh; }
    .slider.round:before { border-radius: 50%; }

    /* ── Footer ── */
    .links {
      text-align: center;
      font-weight: bold;
      margin: 0.75rem 0 0;
      font-size: 0.85rem;
    }

    .links a { color: #76bfff; }

    /* ── Reset preferences ── */
    .reset-prefs-row {
      text-align: center;
      margin: 0.25rem 0 0;
    }

    .reset-prefs-btn {
      background: transparent;
      border: none;
      color: #555;
      font-size: 0.75rem;
      text-decoration: underline;
      cursor: pointer;
      font-family: inherit;
      padding: 0;
    }

    .reset-prefs-btn:hover { color: #888; filter: none; }
