/* The Tooling family's shell over SubTooling's own styles: ink and yellow, a slim header with
   the mark, plain nav pills. Loaded AFTER dark-mode.css so the header stays ink in both modes;
   everything else about dark mode is untouched. */
:root {
    --primary-color: #161617;
    --primary-dark: #2a2a2c;
    --body-bg: #f6f5f1;
    --family-yellow: #e8c547;
}

header, body.dark-mode header { background-color: #161617; color: #fff; box-shadow: none; padding: 0.75rem 0; margin-bottom: 1.5rem; }
body.dark-mode header { background-color: #0f0f10; }
.header-title { display: flex; flex-direction: row; align-items: center; gap: 0.75rem; min-width: 0; }
.family-mark { width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0; }
.family-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
header .header-title h1, body.dark-mode header .header-title h1 { margin: 0; font-size: 1.125rem; font-weight: 700; color: #fff; }
.header-title p, .theme-toggle, .theme-toggle:hover { color: #bdbbb3; }
.title-and-toggle { display: flex; align-items: center; gap: 0.75rem; }
.title-and-toggle p, body.dark-mode .title-and-toggle p { margin: 0; font-size: 0.8125rem; color: #bdbbb3; }
#darkModeToggle, body.dark-mode #darkModeToggle { font-size: 1.1rem; color: #ecebe4; cursor: pointer; }

.main-nav ul { display: flex; gap: 0.4rem; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.main-nav .indent-1, .main-nav .indent-2, .main-nav .indent-3 { margin-left: 0; }
.main-nav a, body.dark-mode .main-nav a { display: inline-block; padding: 0.35rem 0.8rem; border: 1px solid #4a4a4d; border-radius: 999px; background: transparent; box-shadow: none; font-size: 0.875rem; font-weight: 500; letter-spacing: 0; color: #ecebe4; text-decoration: none; }
.main-nav a::after { display: none; }
.main-nav a:hover, body.dark-mode .main-nav a:hover { background: #2a2a2c; color: #fff; }
.main-nav a.active, body.dark-mode .main-nav a.active { background: var(--family-yellow); border-color: var(--family-yellow); color: #161617; font-weight: 600; }

h2 { color: #161617; border-bottom-color: var(--family-yellow); }
.btn.primary { background-color: #161617; border-color: #161617; color: var(--family-yellow); font-weight: 600; }
.btn.primary:hover { background-color: #2a2a2c; border-color: #2a2a2c; }
body.dark-mode .btn.primary { background-color: var(--family-yellow); border-color: var(--family-yellow); color: #161617; }
/* Clear is rare and already asks first: it does not need to be the loudest thing on the page. */
.btn.danger { background: transparent; color: #b3261e; border: 1px solid #e4b4af; }
.btn.danger:hover { background: #fdecea; color: #8c1d18; }
body.dark-mode .btn.danger { color: #f2a59f; border-color: #6e3a36; }
input:focus, textarea:focus, select:focus { border-color: #b89b1f; box-shadow: 0 0 0 0.2rem rgba(232, 197, 71, 0.4); outline: none; }

@media (max-width: 640px) { .title-and-toggle p { display: none; } }

/* Row tools (js/row-tools.js): chips, one header row, compact lines with an x, the job bar. */
.job-bar { position: sticky; top: 0; z-index: 40; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: 0 0 1rem; padding: 0.55rem 0.9rem; background: #fff; border: 1px solid var(--border-color); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); font-size: 0.875rem; color: #6b6a66; }
.job-bar b { color: #161617; font-variant-numeric: tabular-nums; }
.job-bar-total b { font-size: 1.25rem; }
.job-bar-total b.is-empty { color: #b8b6ad; }
body.dark-mode .job-bar { background: #2d2d2d; border-color: #555; color: #bdbbb3; }
body.dark-mode .job-bar b { color: #f0f0f0; }

.type-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0 0 1rem; }
.type-chips-hint { flex-basis: 100%; font-size: 0.8125rem; color: #6b6a66; }
.type-chip { padding: 0.4rem 0.75rem; min-height: 38px; border: 1px solid #cfccc2; border-radius: 999px; background: #fff; color: #161617; font: inherit; font-size: 0.875rem; cursor: pointer; }
.type-chip b { margin-left: 0.4rem; color: #7a6200; font-weight: 600; }
.type-chip:hover { border-color: #161617; }
.type-chip:active { background: #faf6e3; }
body.dark-mode .type-chip { background: #3d3d3d; color: #f0f0f0; border-color: #555; }
body.dark-mode .type-chip b { color: var(--family-yellow); }

.fixture-head, #fixtureItems .fixture-item .form-row { display: grid; gap: 0.5rem; align-items: start; margin: 0; }
.fixture-head.rows-4, #fixtureItems.rows-4 .fixture-item .form-row { grid-template-columns: minmax(0, 1fr) 5rem 6.5rem 7rem 2rem; }
.fixture-head.rows-2, #fixtureItems.rows-2 .fixture-item .form-row { grid-template-columns: minmax(0, 1fr) 5rem 2rem; }
.fixture-head { padding: 0 0 0.35rem; border-bottom: 1px solid var(--border-color); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #6b6a66; }
#fixtureItems .fixture-item { margin: 0; padding: 0.4rem 0; }
#fixtureItems .fixture-item .form-group { margin: 0; min-width: 0; }
#fixtureItems .fixture-item label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#fixtureItems .fixture-item input, #fixtureItems .fixture-item select { width: 100%; }
#fixtureItems .fixture-item input[type="number"] { text-align: right; }
.line-remove { width: 2rem; height: 2.4rem; border: none; border-radius: 6px; background: transparent; color: #b3261e; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.line-remove:hover { background: #fdecea; }
body.dark-mode .line-remove { color: #f2a59f; }
body.dark-mode .line-remove:hover { background: #4a2a28; }
@media (max-width: 640px) {
    .fixture-head { display: none; }
    #fixtureItems.rows-4 .fixture-item .form-row { grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1fr) 2rem; }
    #fixtureItems.rows-4 .fixture-item .item-type { grid-column: 1 / -1; }
    #fixtureItems.rows-2 .fixture-item .form-row { grid-template-columns: minmax(0, 1fr) 4.5rem 2rem; }
}

/* The sheet beside the form (js/live-sheet.js) — wide screens only. */
@media (min-width: 1100px) {
    main.container.has-live-sheet { max-width: 1400px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); column-gap: 1.5rem; align-items: start; }
    main.container.has-live-sheet > * { grid-column: 1; }
    main.container.has-live-sheet > .job-bar { grid-column: 1 / -1; }
    main.container.has-live-sheet > #jobValuePreviewSection { grid-column: 2; grid-row: 2 / span 3; position: sticky; top: 4rem; max-height: calc(100vh - 5rem); overflow: auto; }
}
