/* -----------------------------------------------------------
   Grundlayout
----------------------------------------------------------- */
body {
    font-family: system-ui, sans-serif;
    background: #f7f7f7;
    color: #222;
    margin: 20px;
}

a, a:visited {
    color: unset;
}

/* -----------------------------------------------------------
   Tabellen-Layout
----------------------------------------------------------- */
table[data-id="flexbox-bar-graph"] {
    width: 100%;
    border-collapse: collapse;
    margin: 40px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    table-layout: fixed;
}

/* Erste Spalte (Optimierungsflags) */
table[data-id="flexbox-bar-graph"] th:first-child,
table[data-id="flexbox-bar-graph"] td:first-child {
    width: 100px;
    white-space: nowrap;
    text-align: left;
}

/* Compiler-Spalten */
table[data-id="flexbox-bar-graph"] th:not(:first-child),
table[data-id="flexbox-bar-graph"] td:not(:first-child) {
    text-align: center;
    width: 33%;
}

caption {
    font-size: 1.4em;
    font-weight: 600;
    padding: 15px;
    background: #333;
    color: white;
}

thead th {
    background: #eee;
    padding: 10px;
    font-weight: 600;
    text-align: center;
}

tbody th {
    background: #fafafa;
    padding: 10px;
    text-align: right;
    width: 80px;
    font-weight: 600;
}

tbody td {
    padding: 8px 10px;
}

/* -----------------------------------------------------------
   Balken (Runtime + Size)
----------------------------------------------------------- */
tbody td span,
.bar {
    display: block;
    height: 22px;
    border-radius: 4px;
    color: white;
    font-size: 0.85em;
    padding-left: 6px;
    line-height: 22px;
    white-space: nowrap;
    overflow: hidden;
    animation: grow 0.8s ease-out;
    width: calc(100% * var(--data-set));
    background: hsl(calc(120 - 120 * var(--color-set)), 70%, 45%);
}

tbody td span::after,
.bar::after {
    content: attr(data-value);
    float: right;
    padding-right: 6px;
}

@keyframes grow {
    from { width: 0; }
    to   { width: calc(100% * var(--data-set)); }
}

/* -----------------------------------------------------------
   CPU-Tabs (oben)
----------------------------------------------------------- */
.tabs {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 20px;
}

.tabs > input {
    display: none;
}

.tabs > label {
    padding: 10px 15px;
    background: #eee;
    border: 1px solid #ccc;
    cursor: pointer;
    margin-right: 4px;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    display: inline-block;
}

.tabs > input:checked + label {
    background: white;
    border-bottom: 1px solid white;
}

/* CPU-Tab Inhalt */
.tab-content {
    border: 1px solid #ccc;
    padding: 20px;
    background: white;
    border-radius: 0 6px 6px 6px;
    display: none;
}

/* -----------------------------------------------------------
   Subtabs (Runtime / Size)
----------------------------------------------------------- */
.tabs .tabs {
    margin-top: 10px;
}

.tabs .tabs > label {
    padding: 6px 12px;
    font-size: 0.9em;
    border-radius: 6px 6px 0 0;
}

.tabs .tabs > input:checked + label {
    background: #fff;
    border-bottom: 1px solid #fff;
}

.tabs .tabs .tab-content {
    padding: 15px;
}
