/* Shear check: plain and functional, same look as interaction-diagram.
   Colours as tokens; data-theme on <html> is set by theme.js. */

:root {
    --bg: #fff;
    --text: #222;
    --muted: #555;
    --border: #ccc;
    --input-border: #888;
    --input-bg: #fff;
    --accent: #1f4e79;
    --accent-text: #fff;
    --accent-soft: #eaf1f8;
    --error: #b00020;
    --error-soft: #fdecee;
    --warn-text: #7a4b00;
    --warn-soft: #fff6d6;
    --warn-border: #e0c060;
    --tension-soft: #e8f0fb;
    --table-head: #e2e2e2;
    --table-line: #e4e4e4;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #16181b;
    --text: #e4e6ea;
    --muted: #a6abb3;
    --border: #3a3e45;
    --input-border: #6b7079;
    --input-bg: #1f2226;
    --accent: #7fb2e5;
    --accent-text: #10141a;
    --accent-soft: #1f2d3d;
    --error: #ff6b6b;
    --error-soft: #3a1d20;
    --warn-text: #f0c96a;
    --warn-soft: #3a3120;
    --warn-border: #8a7330;
    --tension-soft: #1d2a3a;
    --table-head: #2c3036;
    --table-line: #30343a;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    color: var(--text);
    background: var(--bg);
}

main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 12px 16px 32px;
}

a {
    color: var(--accent);
}

h1 {
    font-size: 24px;
    margin: 8px 0;
    padding-bottom: 6px;
    border-bottom: thin solid var(--border);
}

h2 {
    font-size: 18px;
}

h3 {
    font-size: 14px;
    margin: 12px 0 0;
}

header p {
    margin: 6px 0 12px;
}

header a {
    margin-left: 12px;
}

.small {
    font-size: 13px;
    color: var(--muted);
}

.error {
    color: var(--error);
}

.start-error {
    padding: 12px 16px;
    font-size: 17px;
    font-weight: bold;
    border: 2px solid var(--error);
    border-radius: 5px;
    background: var(--error-soft);
}

[hidden] {
    display: none !important;
}

/* theme and language switch, at the top right of both pages */

.switches {
    float: right;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.languages button,
.themes button {
    padding: 3px 9px;
    font: inherit;
    font-size: 13px;
    color: var(--accent);
    background: var(--bg);
    border: 1px solid var(--accent);
    border-radius: 3px;
    cursor: pointer;
}

.languages button.active,
.themes button.active {
    color: var(--accent-text);
    background: var(--accent);
}

button {
    font: inherit;
    font-size: 14px;
}

#drop-zone button,
#paste-box button {
    margin: 4px 6px 0 0;
}

/* landing page */

.norms {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.norm {
    flex: 1 1 260px;
    max-width: 420px;
    padding: 20px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
}

.norm:hover,
.norm:focus {
    background: var(--accent-soft);
}

.norm strong {
    display: block;
    font-size: 20px;
    margin-bottom: 6px;
}

/* file */

#drop-zone {
    padding: 10px 12px;
    border: 1px dashed var(--muted);
    border-radius: 5px;
    margin-bottom: 12px;
}

#drop-zone.over {
    background: var(--accent-soft);
    border-color: var(--accent);
}

#drop-zone p {
    margin: 6px 0 0;
}

label.inline {
    display: inline-block;
    margin: 4px 6px 0 0;
    font-size: 14px;
}

select,
textarea {
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 3px;
}

#paste-box {
    margin-top: 8px;
}

#paste-box summary {
    cursor: pointer;
    font-size: 14px;
}

textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 5px 6px;
    font-family: consolas, monospace;
    font-size: 13px;
}

#file-message:empty {
    display: none;
}

/* inputs on the left, diagram on the right */

.layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

fieldset {
    margin: 0 0 12px;
    padding: 8px 10px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
}

legend {
    font-weight: bold;
    padding: 0 4px;
}

label {
    display: block;
    margin-top: 6px;
    font-size: 13px;
}

input[type="text"] {
    display: block;
    width: 100%;
    margin-top: 2px;
    padding: 5px 6px;
    font-size: 15px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 3px;
}

label.check {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin-top: 8px;
}

.choice {
    margin-top: 8px;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid transparent;
    border-radius: 3px;
}

/* the label on a line of its own, the options side by side below it */
.choice-label {
    display: block;
}

.choice .options {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
}

.choice .options label.check {
    display: inline-flex;
    margin-top: 6px;
    white-space: nowrap;
}

input.invalid,
.choice.invalid {
    border-color: var(--error);
    background: var(--error-soft);
}

fieldset p {
    margin: 6px 0 0;
}

/* output */

#messages {
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--error);
    border-radius: 5px;
    background: var(--error-soft);
}

#messages p {
    margin: 2px 0;
}

/* values are still missing: a neutral hint, not an error */
#messages.info {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

/* the input is the example, not a project */
.example-note {
    margin: 0 0 6px;
    padding: 4px 10px;
    font-weight: bold;
    color: var(--warn-text);
    background: var(--warn-soft);
    border: 1px solid var(--warn-border);
    border-radius: 5px;
}

#diagram {
    width: 100%;
    height: 640px;
}

#hints {
    padding-left: 20px;
}

#hints li {
    margin-bottom: 3px;
}

/* table of the load points */

#table {
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--border);
}

#table:empty {
    border: none;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

th,
td {
    padding: 3px 8px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--table-line);
}

th {
    position: sticky;
    top: 0;
    background: var(--table-head);
}

td:last-child,
th:last-child {
    text-align: left;
}

/* a click on the head sorts the table */
th button {
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-weight: bold;
    color: inherit;
    text-align: inherit;
    cursor: pointer;
}

th button:hover,
th button:focus-visible {
    text-decoration: underline;
}

tr.outside td {
    background: var(--error-soft);
    color: var(--error);
}

tr.above td {
    background: var(--warn-soft);
}

/* EN 1992-1-1: point in tension (decision F1) */
tr.tension td {
    background: var(--tension-soft);
}

footer {
    margin-top: 16px;
}

.validation {
    max-width: 860px;
    margin: 16px 0 8px;
}

/* small screen: one column */

@media (max-width: 800px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    #diagram {
        height: 460px;
    }

    .switches {
        float: none;
        justify-content: flex-end;
    }
}
