/* The rule checker, on app.css and the tokens in styles.css. */

.top h1 .home { color: inherit; text-decoration: none; }
.top h1 .sub { color: var(--color-text-secondary); font-weight: 400; }

/* The page fills the window and no more: the editor takes the height
   left, so the buttons under it stay in view and the text shows as many
   lines as fit. On a narrow screen the page flows and the editor has a
   fixed height. */
body.vpage { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
body.vpage .top, body.vpage .foot { flex: none; }
body.vpage .foot { padding: .4rem 1rem; }
.vlayout { flex: 1; min-height: 0; width: 100%; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; padding: 0 1rem; max-width: 90rem; margin: 0 auto; }
.vlayout > .panel { display: flex; flex-direction: column; min-height: 0; overflow: auto; margin: 0; }
.vlayout > .panel:first-child { overflow: hidden; }
@media (max-width: 860px) {
  body.vpage { height: auto; overflow: visible; }
  .vlayout { grid-template-columns: minmax(0, 1fr); }
  .vlayout > .panel:first-child { overflow: visible; }
  .editor { height: 60vh; flex: none !important; }
}

.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: .5rem 0; }
.tab { font: inherit; font-size: .8rem; padding: .15rem .5rem; border: 1px solid var(--color-border-secondary); border-radius: var(--border-radius-md); background: none; cursor: pointer; }
.tab.on { background: var(--color-background-info); color: var(--color-text-info); border-color: transparent; }

label.name { display: flex; gap: .5rem; align-items: center; font-size: .85rem; margin: .25rem 0; }
label.name input { flex: 1; font-family: var(--font-mono, ui-monospace, monospace); font-size: .85rem; }

/* Line numbers beside the text, scrolled with it: the diagnostics name lines. */
.editor { flex: 1; min-height: 8rem; display: flex; border: 1px solid var(--color-border-secondary); border-radius: var(--border-radius-md); overflow: hidden; }
.gutter { margin: 0; padding: .25rem .4rem .25rem .5rem; min-width: 2.5rem; box-sizing: border-box; text-align: right; color: var(--color-text-tertiary); background: var(--color-background-secondary); font-family: var(--font-mono, ui-monospace, monospace); font-size: .85rem; line-height: 1.4; overflow: hidden; user-select: none; height: 100%; }
.gutter .hit { color: var(--color-text-danger); font-weight: 600; }
/* The problem lines, tinted behind the (transparent) text. */
.text { position: relative; flex: 1; min-width: 0; }
.backdrop { position: absolute; inset: 0; overflow: hidden; padding: .25rem 0; font-family: var(--font-mono, ui-monospace, monospace); font-size: .85rem; line-height: 1.4; pointer-events: none; }
.backdrop div { height: 1.4em; }
.backdrop div.error { background: var(--color-background-danger, #fee2e2); }
.backdrop div.warning { background: var(--color-background-warning, #fef3c7); }
.gutter .hit.warning { color: var(--color-text-warning); }
textarea#source { position: relative; background: transparent; display: block; flex: 1; border: none; outline: none; padding: .25rem .5rem; margin: 0; width: 100%; box-sizing: border-box; height: 100%; resize: none; font-family: var(--font-mono, ui-monospace, monospace); font-size: .85rem; line-height: 1.4; tab-size: 2; white-space: pre; overflow: auto; }

fieldset.mode { border: none; padding: 0; margin: 0 0 .5rem; }
fieldset.mode legend { font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }

.verdict { font-weight: 600; margin: .25rem 0; }
.verdict.ok { color: var(--color-text-success, #15803d); }
.verdict.bad { color: var(--color-text-danger); }

ul.diags { list-style: none; padding: 0; margin: .5rem 0; }
.diag { padding: .3rem .4rem; border-bottom: 1px solid var(--color-border-tertiary); font-size: .88rem; overflow-wrap: anywhere; }
.diag[data-file] { cursor: pointer; }
.diag[data-file]:hover { background: var(--color-background-secondary); }
.diag .sev { display: inline-block; font-size: .7rem; padding: 0 .35rem; border-radius: 4px; text-transform: uppercase; }
.diag.error .sev { background: var(--color-background-danger, #fee2e2); color: var(--color-text-danger); }
.diag.warning .sev { background: var(--color-background-warning); color: var(--color-text-warning); }
.diag.info .sev { background: var(--color-background-info); color: var(--color-text-info); }
fieldset.mode label.check { display: block; margin: .15rem 0; }
