/* Local tools share the workshop palette, typography and flat paper surfaces. */
.tools-page { padding: 46px 0 72px; }
.tools-page [hidden] { display: none !important; }
.tools-page-head { margin-bottom: 34px; max-width: 760px; }
.tools-kicker { color: var(--studio-purple); font: 600 .73rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .06em; margin-bottom: 13px; }
.tools-page h1 { font-size: clamp(2.3rem, 4.5vw, 3.5rem); line-height: 1.13; letter-spacing: -.05em; margin: 0 0 22px; }
.tools-page h1 span { color: var(--studio-purple); }
.tools-lead { max-width: 57ch; color: var(--studio-muted); font-size: 1.04rem; line-height: 1.8; }
.tools-back { display: inline-flex; color: var(--studio-muted); text-decoration: none; font-size: .8rem; margin-bottom: 28px; }
.tools-back:hover { color: var(--studio-purple); }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tools-card { border: 1px solid var(--studio-ink); border-radius: 9px; color: var(--studio-ink); text-decoration: none; padding: 30px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.tools-card:hover { box-shadow: 5px 5px 0 var(--studio-ink); transform: translate(-2px, -2px); }
.tools-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.tools-card-icon { display: grid; place-items: center; width: 67px; height: 60px; background: var(--studio-lilac); border-radius: 7px; color: var(--studio-purple); font: 700 1.2rem/1 ui-monospace, monospace; }
.tools-tag { color: #245d4b; background: var(--studio-mint); border-radius: 4px; padding: 4px 8px; font-size: .68rem; font-weight: 650; }
.tools-card h2 { font-size: 1.5rem; line-height: 1.3; letter-spacing: -.03em; margin: 7px 0 0; }
.tools-card p { font-size: .91rem; line-height: 1.8; color: var(--studio-muted); }
.tools-card-link { display: flex; width: 100%; align-items: center; justify-content: space-between; color: var(--studio-purple); font-weight: 750; font-size: .85rem; border-top: 1px solid var(--studio-line); padding-top: 19px; margin-top: auto; }
.tools-card-link span { font-size: 1.2rem; }
.tools-footnote { color: var(--studio-muted); font-size: .8rem; margin-top: 28px; max-width: 65ch; }
/* The checker keeps one input panel and one bounded results panel. */
.yg-checker { padding: 28px 0 56px; }
.yg-page-head { max-width: none; margin-bottom: 25px; }
.yg-page-head .tools-back { margin-bottom: 18px; }
.yg-page-head h1 { max-width: 980px; font-size: clamp(1.7rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -.035em; margin-bottom: 12px; }
.yg-page-head .tools-lead { max-width: 90ch; font-size: .9rem; line-height: 1.7; }
.yg-workbench { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.yg-upload-panel, .yg-overview, .yg-results-pane { min-width: 0; border: 1px solid var(--studio-line); border-radius: 8px; padding: 20px; background: #fff; }
.yg-upload-panel h2, .yg-results-heading h2 { font-size: 1rem; letter-spacing: -.02em; margin: 0; line-height: 1.4; }
.yg-upload-panel h2 { margin-bottom: 14px; }
.yg-dropzone { min-height: 112px; padding: 18px 12px; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; text-align: center; border: 1px dashed #b8accf; border-radius: 6px; background: #faf8ff; cursor: pointer; }
.yg-dropzone:hover, .yg-dropzone.is-dragover { border-color: var(--studio-purple); background: var(--studio-lilac); }
.yg-dropzone:focus-within { outline: 2px solid var(--studio-purple); outline-offset: 3px; }
.yg-dropzone input[type="file"], .yg-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.yg-dropzone strong { font-size: .875rem; color: var(--studio-purple); }
.yg-dropzone strong span { color: var(--studio-ink); font-weight: 500; }
.yg-dropzone small { font-size: .75rem; color: var(--studio-muted); }
.yg-file-info { font-size: .75rem; line-height: 1.5; color: var(--studio-muted); margin: 9px 0 18px; overflow-wrap: anywhere; }
.tools-page select { width: 100%; font: inherit; color: var(--studio-ink); background: #fff; border: 1px solid var(--studio-line); border-radius: 5px; min-height: 36px; padding: 6px 8px; }
.yg-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 16px; margin-top: 22px; }
.yg-button, .yg-text-button { font-family: inherit; cursor: pointer; }
.yg-button { display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; line-height: 1.4; font-weight: 700; border: 1px solid var(--studio-purple); border-radius: 5px; min-height: 42px; padding: 10px 18px; }
.yg-button-primary { color: #fff; background: var(--studio-purple); }
.yg-button-primary:hover { background: #503bc5; }
.yg-text-button { border: 0; padding: 5px 0; background: none; color: var(--studio-purple); font-size: .75rem; line-height: 1.4; }
.yg-text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.yg-button:disabled, .yg-text-button:disabled { opacity: .5; cursor: default; }
.tools-page :is(button, select, input, a):focus-visible { outline: 2px solid var(--studio-purple); outline-offset: 3px; }
.yg-status { min-height: 2.9em; margin-top: 12px; font-size: .75rem; line-height: 1.45; color: var(--studio-muted); overflow-wrap: anywhere; }
.yg-privacy { display: flex; align-items: flex-start; gap: 7px; font-size: .72rem; line-height: 1.5; color: #356451; margin-top: 13px; }
.yg-privacy svg { width: 14px; height: 17px; flex: 0 0 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.yg-results-pane { height: var(--yg-panel-height, 470px); max-height: var(--yg-panel-height, 470px); display: flex; flex-direction: column; overflow: hidden; }
.yg-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; text-align: center; gap: 10px; color: var(--studio-muted); }
.yg-empty h2 { font-size: .95rem; color: var(--studio-ink); font-weight: 600; }
.yg-empty p { font-size: .8rem; line-height: 1.7; }
.yg-results { min-height: 0; display: flex; flex: 1; flex-direction: column; overflow: hidden; }
.yg-results > :not(.yg-report-scroll) { flex-shrink: 0; }
.yg-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--studio-line); }
.yg-list-hint { font-size: .7rem; color: var(--studio-muted); }
.yg-overview { min-height: var(--yg-panel-height, 470px); display: flex; flex-direction: column; }
.yg-overline { font-size: .75rem; color: var(--studio-muted); margin-bottom: 10px; }
.yg-overview h2 { font-size: 1.45rem; letter-spacing: -.035em; line-height: 1.2; margin: 0 0 12px; }
.yg-overview[data-verdict="error"] h2 { color: #ac4038; }
.yg-overview[data-verdict="pass"] h2 { color: #2d7557; }
.yg-verdict-detail { font-size: .82rem; line-height: 1.65; color: var(--studio-muted); overflow-wrap: anywhere; }
.yg-score-note { font-size: .72rem; line-height: 1.6; color: var(--studio-muted); margin: 12px 0 22px; }
.yg-overview-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.yg-overview .yg-file-list { border-top: 1px solid var(--studio-line); padding-top: 14px; }
.yg-export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.yg-summary { display: flex; flex-wrap: wrap; gap: 5px 15px; font-size: .75rem; margin-bottom: 14px; }
.yg-stat { display: inline-flex; gap: 4px; color: var(--studio-muted); }
.yg-stat strong { font-weight: 700; }
.yg-stat[data-severity="error"] { color: #ac4038; }
.yg-stat[data-severity="warning"] { color: #906415; }
.yg-stat[data-severity="pass"] { color: #2d7557; }
.yg-report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--studio-line); }
.yg-file-list { font-size: .75rem; color: var(--studio-muted); overflow-wrap: anywhere; }
.yg-report-toolbar label { flex: 0 0 auto; }
.yg-report-toolbar select { font-size: .75rem; min-height: 30px; padding: 4px 7px; }
.yg-report-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; overscroll-behavior: contain; padding-right: 5px; }
.yg-report-scroll:focus-visible { outline: 2px solid var(--studio-purple); outline-offset: -2px; }
.yg-finding { border-bottom: 1px solid var(--studio-line); }
.yg-findings { list-style: none; padding: 0; margin: 0; }
.yg-finding-heading { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 10px; align-items: center; gap: 10px; width: 100%; padding: 12px 1px; border: 0; background: none; text-align: left; font: inherit; color: var(--studio-ink); cursor: pointer; }
.yg-finding-heading:hover { background: #faf8ff; }
.yg-finding-heading::after { content: '›'; font-size: 1.2rem; line-height: 1; color: var(--studio-muted); }
.yg-finding-title { font-size: .85rem; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.yg-finding-number { color: var(--studio-muted); font: .7rem/1 ui-monospace, monospace; }
.yg-badge { font-size: .7rem; color: #76668e; white-space: nowrap; }
.yg-finding[data-severity="error"] .yg-badge { color: #ac4038; }
.yg-finding[data-severity="warning"] .yg-badge { color: #906415; }
.yg-finding[data-severity="pass"] .yg-badge { color: #2d7557; }
.yg-limits { max-width: 100ch; margin-top: 20px; color: var(--studio-muted); font-size: .75rem; line-height: 1.8; }
.yg-limits a { color: var(--studio-purple); text-underline-offset: 3px; }
.yg-detail-dialog { margin: auto; width: min(620px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 24px; border: 1px solid var(--studio-line); border-radius: 9px; color: var(--studio-ink); background: #fff; overflow-y: auto; }
.yg-detail-dialog::backdrop { background: rgb(28 22 45 / 35%); }
.yg-dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.yg-dialog-heading h2 { font-size: 1.1rem; line-height: 1.4; margin: 0; }
.yg-dialog-close { flex: 0 0 30px; border: 0; border-radius: 4px; background: #f5f2fa; color: var(--studio-ink); width: 30px; height: 30px; font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.yg-finding-detail, .yg-finding-fix { color: var(--studio-muted); font-size: .875rem; line-height: 1.8; overflow-wrap: anywhere; }
.yg-finding-fix { margin-top: 14px; color: var(--studio-ink); }
.yg-finding-evidence { margin-top: 14px; padding: 12px; font: .75rem/1.7 ui-monospace, monospace; border-radius: 5px; background: #f7f5fa; white-space: pre-wrap; overflow-wrap: anywhere; }
.yg-finding-source { display: inline-block; margin-top: 16px; color: var(--studio-purple); font-size: .8rem; text-underline-offset: 3px; }
.yg-notice { color: #906415; font-size: .8rem; margin-top: 10px; }
@media (max-width: 900px) {
  .yg-workbench { grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr); gap: 16px; }
  .yg-upload-panel, .yg-overview, .yg-results-pane { padding: 16px; }
  .yg-finding-heading { gap: 6px; }
}
@media (max-width: 768px) {
  .tools-page { padding: 24px 0 40px; }
  .tools-page-head { margin-bottom: 22px; }
  .tools-page h1 { font-size: 2rem; }
  .yg-page-head h1 { font-size: 1.65rem; }
  .tools-grid, .yg-workbench { grid-template-columns: minmax(0, 1fr); }
  .tools-card { padding: 23px; }
  .yg-page-head .tools-back { margin-bottom: 14px; }
  .yg-results-pane { height: min(var(--yg-panel-height, 470px), 600px); max-height: 600px; }
  .yg-page-head .tools-lead { font-size: .85rem; }
  .yg-detail-dialog { padding: 18px; }
  .yg-overview { min-height: 0; }
  .yg-finding-heading { grid-template-columns: 18px minmax(0, 1fr) auto 8px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .tools-page *, .tools-page *::before, .tools-page *::after { transition: none !important; animation: none !important; }
}

.yg-input-note { color: var(--studio-muted); font-size: .8rem; line-height: 1.7; margin-top: 16px; }
.yg-checked { font-weight: 700; font-size: .9rem; margin: 24px 0 14px; }
.yg-overview .yg-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.yg-overview .yg-stat { display: flex; flex-direction: column; gap: 4px; }
.yg-overview .yg-stat strong { font-size: 1.7rem; line-height: 1.2; }
.yg-analysis-limits { display: flex; flex-direction: column; align-items: flex-start; margin-top: 12px; gap: 6px; }
.yg-analysis-limits button { text-align: left; }
