/* ── Print ────────────────────────────────────────────────────── */

@media print {
    #the-view > * {
        display: none !important; /* !important overrides various !important rules in aco-layout/Bootstrap. */
    }

    #the-view > .printable {
        display: revert !important;
    }
}

@media not print {
    #print-parts-needed {
        display: none;
    }
}

/* ── General ──────────────────────────────────────────────────── */

.square-selector-button {
    padding: 0.1rem;
    width: 2.5rem;
    height: 2.5rem;
}

.custom-numeric-input {
    width: 7rem;
    border: 1pt solid #BBC;
}

.custom-numeric-input input::-webkit-inner-spin-button,
.custom-numeric-input input::-webkit-outer-spin-button {
          appearance: none;
  -webkit-appearance: none; /* Necessary to hide built-in step buttons in Chrome. */
}

.custom-numeric-input input {
    appearance: none;
    -moz-appearance: textfield; /* Necessary to hide built-in step buttons in Firefox. */
    border-bottom: none; /* Prevents layout shifting on focus due to aco-layout setting a border-bottom whose thickness changes on focus. Also difficult to make bottom border look good when input wrapped in border together with –/+ buttons. */
}

.custom-numeric-input-step-button > span {
    font-size: 2rem;
    position: relative;
    top: -0.2rem; /* Otherwise it doesn't appear vertically centered. Exact value picked simply based on what happened to look OK. */
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* ── Sidebar ──────────────────────────────────────────────────── */

.sidebar {
    width: 19rem;
    flex-shrink: 0;
}

/* ── Language selector buttons ───────────────────────────────────── */

.language-button:hover {
    opacity: 1 !important; /* !important overrides Bootstrap's opacity-50 utility. */
}

/* ── Shape selector ───────────────────────────────────── */

.welcome-shape-button {
    width: 8rem;
}

.shape-button svg path {
    fill: none;
    stroke: black;
    stroke-width: 8;
}

/* ── Dimensions configuration ──────────────────────────────────── */

.system-dimensions {
    height: 11rem; /* Prevents layout shifting when its content changes. */
}

/* ── Grating selector buttons ───────────────────────────────────── */

.grating-button {
    opacity: 0.65;
    padding: 0; /* So that the SVG inside can fill the entire button. */
}

.grating-button:hover {
    opacity: 1;
}

.grating-button.selected {
    border-color: #222 !important; /* !important overrides Bootstrap's border utility. */
    opacity: 1;
}

/* ── Parts table ──────────────────────────────────────────────── */

.parts-table {
    --bs-table-bg: transparent;
}

.parts-table .article-image-container {
    width: 3rem;
    height: 3rem;
}

@media print {
    .parts-table td {
        padding-top: 0.1rem;
        padding-top: 0.1rem;
    }
}

@media not print {
    .parts-table .article-image-column img {
        border: 1pt solid #bbb;
    }
}

.parts-table th.quantity-column,
.parts-table td.quantity-column {
    width: 2.5rem;
}

.parts-table th.article-name-column,
.parts-table td.article-name-column {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0; /* Allows the td to shrink below content width so overflow: hidden takes effect. */
}

.parts-table td:not(:first-child) {
    border-left: none; /* `table` class in `aco-layout` sets a border. */
}

/* ── Visualization main area ──────────────────────────────────── */


.visualization-main svg {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 4rem);
    user-select: none; /* Prevents accidentally highlighting text when e.g. double-clicking. */
}

.visualization-main svg text {
    user-select: text;
}

@media print {
    .visualization-main svg {
        max-height: 50%;
    }
}

/* ── Outlet slots ──────────────────────────────────────────────── */

.outlet-slot {
    cursor: pointer;
}

.outlet-slot__indicator {
    fill: transparent;
}

.outlet-slot:hover .outlet-slot__indicator {
    fill: rgba(0, 100, 200, 0.3);
}
