.orm-section {
    --orm-surface:      #ffffff;
    --orm-panel:        #faf8f6;
    --orm-track:        #f3efeb;
    --orm-line:         #e5dfd9;
    --orm-text:         #1f1b18;
    --orm-muted:        #6e655f;
    --orm-soft:         #9c928b;
    --orm-accent:       #8c523e;
    --orm-accent-soft:  #f5ece8;
    --orm-green:        #6b705c;
    --orm-green-soft:   #f2f3ef;
    padding: 20px 0;
    color: var(--orm-text);
}

.orm-section *,
.orm-section *::before,
.orm-section *::after { box-sizing: border-box; }

.orm-section [hidden] { display: none !important; }

.orm-wrap {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Shell ── */
.orm {
    overflow: hidden;
    background: var(--orm-surface);
    border: 1px solid var(--orm-line);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15,23,42,.07);
}

/* ── Top bar ── */
.orm-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--orm-line);
}

/* ── Segment controls ── */
.orm-seg {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    background: var(--orm-track);
    border: 1px solid var(--orm-line);
    border-radius: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
}
.orm-seg::-webkit-scrollbar { display: none; }

.orm-seg-btn {
    flex: 0 0 auto;
    padding: 5px 11px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--orm-muted);
    white-space: nowrap;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 7px;
    transition: background .15s, color .15s, box-shadow .15s;
    font-family: inherit;
}
.orm-seg-btn:hover { color: var(--orm-text); }
.orm-seg-btn.is-active {
    color: var(--orm-text);
    background: var(--orm-surface);
    box-shadow: 0 1px 3px rgba(15,23,42,.1);
}
.orm-seg--primary .orm-seg-btn.is-active {
    color: #fff;
    background: var(--orm-accent);
    box-shadow: 0 2px 6px rgba(140,82,62,.28);
}

.orm-formula-dd {
    display: none;
    position: relative;
}

.orm-formula-select {
    width: 100%;
    height: 36px;
    padding: 0 32px 0 12px;
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--orm-text);
    background-color: var(--orm-track);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236e655f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 1px solid var(--orm-line);
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.orm-formula-select:focus-visible {
    outline: 2px solid var(--orm-accent);
    outline-offset: 2px;
}

/* ── Focus rings ── */
.orm-seg-btn:focus-visible,
.orm-step:focus-visible,
.orm-copy:focus-visible,
.orm-range:focus-visible {
    outline: 2px solid var(--orm-accent);
    outline-offset: 2px;
}

/* ── Two-column body ── */
.orm-body {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
}

/* ── Left: inputs ── */
.orm-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.orm-card {
    overflow: hidden;
    background: var(--orm-surface);
    border: 1px solid var(--orm-line);
    border-radius: 12px;
}

.orm-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-bottom: 1px solid var(--orm-line);
}
.orm-card-head--load { background: var(--orm-accent-soft); }
.orm-card-head--reps { background: var(--orm-green-soft); }

.orm-badge {
    padding: 2px 7px;
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-radius: 6px;
}
.orm-card-head--load .orm-badge { color: var(--orm-accent); background: #ead9d2; }
.orm-card-head--reps .orm-badge { color: var(--orm-green);  background: #e4e7df; }

.orm-card-title {
    font-size: .875rem;
    font-weight: 700;
    color: var(--orm-text);
}

.orm-card-body { padding: 12px 14px; }

.orm-label {
    display: block;
    margin-bottom: 6px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--orm-muted);
}

/* ── Stepper ── */
.orm-stepper {
    display: flex;
    align-items: stretch;
    height: 44px;
    overflow: hidden;
    background: var(--orm-surface);
    border: 1px solid var(--orm-line);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s;
}
.orm-stepper:focus-within {
    border-color: var(--orm-accent);
    box-shadow: 0 0 0 3px rgba(140,82,62,.14);
}

.orm-step {
    flex: 0 0 44px;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    color: var(--orm-text);
    cursor: pointer;
    background: var(--orm-panel);
    border: 0;
    transition: background .15s;
    font-family: inherit;
}
.orm-step:first-child { border-right: 1px solid var(--orm-line); }
.orm-step:last-child  { border-left:  1px solid var(--orm-line); }
.orm-step:hover { background: var(--orm-track); }

.orm-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 6px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--orm-text);
    text-align: center;
    background: transparent;
    border: 0;
    outline: 0;
    font-family: inherit;
}
.orm-input::placeholder { color: var(--orm-soft); }

/* ── Range slider ── */
.orm-range {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 20px;
    margin: 12px 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    outline: none;
    cursor: pointer;
}
.orm-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: var(--orm-line);
    border: 0;
    border-radius: 99px;
}
.orm-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -6px;
    background: var(--orm-accent);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(15,23,42,.22);
    cursor: pointer;
}
.orm-range::-moz-range-track {
    width: 100%;
    height: 6px;
    background: var(--orm-line);
    border: 0;
    border-radius: 99px;
}
.orm-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--orm-accent);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(15,23,42,.22);
    cursor: pointer;
}

.orm-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: .6875rem;
    color: var(--orm-soft);
}

.orm-hint {
    margin: 0;
    font-size: .75rem;
    line-height: 1.55;
    color: var(--orm-muted);
    text-align: center;
}

/* ── Right: result ── */
.orm-result {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px;
    background: var(--orm-panel);
    border-left: 1px solid var(--orm-line);
}

.orm-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.orm-result-title {
    margin: 0;
    font-size: .875rem;
    font-weight: 700;
    color: var(--orm-text);
}

.orm-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--orm-text);
    cursor: pointer;
    background: var(--orm-surface);
    border: 1px solid var(--orm-line);
    border-radius: 8px;
    transition: background .15s, color .15s;
    font-family: inherit;
}
.orm-copy:hover:not(:disabled) { background: var(--orm-accent-soft); color: var(--orm-accent); }
.orm-copy:disabled { cursor: not-allowed; color: var(--orm-soft); }

.orm-icon { display: block; flex: 0 0 auto; }

/* ── Empty state ── */
.orm-empty {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 220px;
    text-align: center;
}
.orm-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--orm-accent);
    background: var(--orm-accent-soft);
    border-radius: 12px;
}
.orm-empty-text {
    margin: 0;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--orm-muted);
}

/* ── Big number ── */
.orm-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    line-height: 1;
}
.orm-value-num {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--orm-accent);
}
.orm-value-unit {
    font-size: 1rem;
    font-weight: 700;
    color: var(--orm-muted);
}

.orm-meta {
    margin: 6px 0 0;
    font-size: .75rem;
    color: var(--orm-muted);
}

/* ── Low / Avg / High ── */
.orm-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
    margin: 14px 0 0;
}
.orm-stat {
    padding: 10px;
    background: var(--orm-surface);
    border: 1px solid var(--orm-line);
    border-radius: 10px;
}
.orm-stat dt {
    margin: 0 0 3px;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--orm-muted);
}
.orm-stat dd {
    margin: 0;
    font-size: .9375rem;
    font-weight: 700;
    color: var(--orm-text);
}

/* ── Warning note ── */
.orm-note {
    margin: 10px 0 0;
    padding: 8px 10px;
    font-size: .75rem;
    line-height: 1.5;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

/* ── Percentage table ── */
.orm-table {
    width: 100%;
    margin-top: 14px;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--orm-surface);
    border: 1px solid var(--orm-line);
    border-radius: 10px;
    overflow: hidden;
}
.orm-table th,
.orm-table td {
    padding: 7px 12px;
    font-size: .8125rem;
    text-align: left;
    border-bottom: 1px solid var(--orm-line);
}
.orm-table thead th {
    font-size: .6875rem;
    font-weight: 700;
    color: var(--orm-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--orm-panel);
}
.orm-table tbody th   { font-weight: 700; color: var(--orm-accent); }
.orm-table tbody td:nth-child(2) { font-weight: 700; color: var(--orm-text); }
.orm-table tbody td:nth-child(3) { color: var(--orm-muted); }
.orm-table tbody tr:first-child  { background: var(--orm-accent-soft); }
.orm-table tbody tr:last-child th,
.orm-table tbody tr:last-child td { border-bottom: 0; }

/* ── Screen-reader only ── */
.orm-sr {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .orm-body { grid-template-columns: minmax(0,1fr); }
    .orm-result { border-top: 1px solid var(--orm-line); border-left: 0; }
    .orm-empty { min-height: 180px; }
}

@media (max-width: 768px) {
    .orm-wrap { padding: 0 10px; }
}

@media (max-width: 600px) {
    .orm-section { padding: 14px 0; }
    .orm-wrap    { padding: 0 10px; }
    .orm-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px;
        gap: 8px;
    }
    .orm-seg--primary { flex: 0 0 auto; }
    .orm-seg--formula { display: none; }
    .orm-formula-dd   { display: block; flex: 1 1 auto; min-width: 0; }
    .orm-inputs,
    .orm-result { padding: 12px; gap: 10px; }
    .orm-stats  { gap: 6px; }
    .orm-stat   { padding: 8px; }
}


.cs-table--text {
    min-width: 0;
}

@media (max-width: 600px) {
    .cs-table--chart { min-width: 0; }
}
@media (max-width: 600px) {
    .cs-table--wrap tbody th { white-space: normal; }
    .cs-table--wrap code { overflow-wrap: anywhere; }
    .cs-chart .cs-table--compact th,
    .cs-chart .cs-table--compact td { padding: 8px 4px; font-size: 0.75rem; }
    .cs-chart .cs-table--compact thead th { font-size: 0.625rem; letter-spacing: 0.02em; }
}
