body.portal { line-height: 1.6; }
.ng-shell { max-width: 900px; margin: 0 auto; padding: 24px 16px 56px; }
.ng-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ng-h1-sub { display: block; margin-top: 4px; color: var(--muted); font-size: .55em; font-weight: 700; letter-spacing: 0; }
.ng-intro h1 { margin-bottom: 12px; }
.ng-intro .lead { margin-bottom: 16px; font-size: 17px; }
.ng-tool { margin: 22px 0 36px; padding: 16px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ng-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0; }

.ng-label { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; color: var(--text); font-size: 14px; font-weight: 750; }
.ng-label:first-of-type { margin-top: 0; }
.ng-num { display: inline-grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }
.ng-hint { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.ng-hint code, .ng-article code { padding: 1px 5px; border-radius: 6px; background: var(--surface-soft); font-size: .92em; }
.ng-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.ng-setup label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; font-weight: 650; }
.ng-setup select { min-height: 40px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--text); font: inherit; font-weight: 700; }
.ng-chips, .ng-controls, .ng-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ng-presets { margin-top: 12px; }
.ng-presets-label { color: var(--muted); font-size: 14px; font-weight: 700; }
.ng-chip { min-width: 44px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.ng-chip:hover:not(:disabled) { border-color: var(--accent); }
.ng-chip:disabled { opacity: .45; cursor: default; }
.ng-chip[aria-pressed="true"], .ng-chip-strong { background: var(--accent); border-color: var(--accent); color: #fff; }
.ng-chip-quiet { background: transparent; color: var(--muted); }

/* Clue boxes: rows and columns side by side on wide screens, stacked on phones. */
.ng-clues { display: grid; gap: 12px; }
.ng-fieldset { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.ng-fieldset legend { padding: 0 4px; color: var(--text); font-size: 13px; font-weight: 750; }
.ng-clue-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.ng-clue { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ng-clue span { flex: 0 0 2.4em; color: var(--muted); font-size: 12px; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.ng-clue input { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 40px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; }
.ng-clue input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ng-clue input[aria-invalid="true"] { border-color: #c0392b; background: #fdecea; }
.ng-paste { margin-top: 12px; }
.ng-paste summary { color: var(--text); font-size: 14px; font-weight: 750; cursor: pointer; }
.ng-paste textarea { display: block; box-sizing: border-box; width: 100%; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: 15px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ng-paste-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.ng-paste-status { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.ng-paste-status:empty { display: none; }

.ng-solve { width: 100%; font-size: 16px; }
.ng-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.ng-status { min-height: 1.6em; margin: 12px 0; color: var(--text); font-size: 14px; }

/* The board: column clues on top, row clues on the left, cells in the middle.
   Big grids scroll inside their own box, never the page. */
.ng-board-wrap { max-width: 100%; overflow: auto; scroll-margin-top: 12px; -webkit-overflow-scrolling: touch; }
.ng-board { --cols: 10; --cell: 26px; display: grid; grid-template-columns: max-content repeat(var(--cols), var(--cell)); width: max-content; margin: 0 auto; font-size: max(10px, calc(var(--cell) * .5)); font-variant-numeric: tabular-nums; line-height: 1.15; }
.ng-corner { background: transparent; }
.ng-colclue { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 2px 0 4px; color: var(--text); font-weight: 700; }
.ng-rowclue { display: flex; align-items: center; justify-content: flex-end; gap: .4em; padding: 0 6px 0 4px; color: var(--text); font-weight: 700; white-space: nowrap; }
.ng-colclue.ng-active, .ng-rowclue.ng-active { background: #ffe9a8; color: #1d1a26; border-radius: 4px; }
.ng-cell { position: relative; box-sizing: border-box; width: var(--cell); height: var(--cell); border-right: 1px solid #c9c3b4; border-bottom: 1px solid #c9c3b4; background: #fffdf7; }
.ng-cell.ng-top { border-top: 2px solid #4a4458; }
.ng-cell.ng-left { border-left: 2px solid #4a4458; }
.ng-cell.ng-last-r { border-right: 2px solid #4a4458; }
.ng-cell.ng-last-b { border-bottom: 2px solid #4a4458; }
.ng-cell.ng-split-r { border-right: 2px solid #4a4458; }
.ng-cell.ng-split-b { border-bottom: 2px solid #4a4458; }
.ng-filled { background: #1d1a26; }
.ng-empty::after { content: ''; position: absolute; inset: 0; margin: auto; width: 22%; height: 22%; border-radius: 50%; background: #cfc8b8; }
.ng-new { box-shadow: inset 0 0 0 2px #e0a210; }
.ng-filled.ng-new { background: #3b5bdb; box-shadow: none; }
.ng-diff { box-shadow: inset 0 0 0 3px #e03131; }

.ng-result { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.ng-result:focus { outline: none; }
.ng-result-title { margin: 0 0 8px; font-size: 22px; }
.ng-note { margin: 0 0 10px; font-size: 14px; }
.ng-caption { min-height: 1.6em; margin: 0 0 10px; color: var(--text); font-size: 15px; }
.ng-controls { margin-bottom: 12px; }
.ng-controls .ng-chip { padding: 8px 12px; }
.ng-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ng-copy-status { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 13px; }
.ng-copy-status:empty { display: none; }

.ng-article h2 { margin: 30px 0 12px; font-size: 24px; }
.ng-article li { margin-bottom: 8px; color: var(--muted); }
.ng-article li strong { color: var(--text); }
.ng-faq details { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ng-faq summary { color: var(--text); font-weight: 750; cursor: pointer; }
.ng-faq details p { margin: 8px 0 0; }
.ng-cta { margin-top: 32px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.ng-cta h2 { margin-top: 0; }
.ng-cta .text-link { color: var(--accent-strong); }
.ng-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (min-width: 720px) {
  .ng-shell { padding: 36px 24px 64px; }
  .ng-tool { padding: 22px; }
  .ng-clues { grid-template-columns: 1fr 1fr; }
}
