.pet-recipe-table {
    --pad-x: 14px;
    --pad-y: 9px;
    --step: 26px;
    --art: 42px;
    --toggle: 20px;
    --gap: 7px;
    --pivot: calc(var(--toggle) / 2);
    --joint: calc(var(--pad-y) + var(--art) / 2);
    --rail-color: #90a99b;
    --focus: #a7762c;
    --tail-offset: calc(var(--toggle) + var(--gap));
    min-width: 0;
    width: 100%;
    color: #213f36;
    font-family: var(--sans);
}
.recipe-table-sheet {
    width: 100%;
    overflow: hidden;
    border: 1px solid #c8d3c7;
    border-radius: 8px;
    background: #fffef8;
}
.pet-recipe-table[data-long] > .recipe-table-sheet {
    max-height: clamp(270px, 65vh, 760px);
    overflow: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #a4b6a9 #eff3ec;
}
.recipe-table-grid {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}
.pet-recipe-table[data-layout="wide"] col:first-child { width: 59%; }
.pet-recipe-table[data-layout="wide"] col:nth-child(2) { width: 16%; }
.pet-recipe-table[data-layout="wide"] col:nth-child(3) { width: 25%; }
.recipe-table-grid th, .recipe-table-grid td {
    padding: var(--pad-y) var(--pad-x);
    text-align: start;
    vertical-align: top;
    font-weight: 400;
    overflow-wrap: anywhere;
}
.recipe-table-grid thead th {
    padding-block: 8px;
    background: #254947;
    color: #fbf8e9;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}
.recipe-table-grid thead th + th { border-inline-start: 1px solid #47645d; }
.pet-recipe-table[data-long] thead th { position: sticky; top: 0; z-index: 2; }
.recipe-table-grid tbody tr { scroll-margin-block: 40px 6px; }
.recipe-table-grid tbody td, .recipe-table-grid tbody th {
    background: #fffef9;
    border-bottom: 1px solid #e1e6da;
}
.recipe-table-grid tbody > tr > * + * { border-inline-start: 1px solid #dce3d6; }
.recipe-table-grid tbody:last-child > tr:last-child > * { border-bottom: 0; }
.recipe-table-grid tr[data-side="root"] > * { background: #edf3e8; }
.recipe-table-grid .recipe-table-match > tr > * { background: #fff0c9; }
.recipe-table-grid tr:focus > .recipe-tree-cell { outline: 2px solid var(--focus); outline-offset: -2px; }

/* All segments share the disclosure's horizontal center and the portrait's vertical center. */
.recipe-tree-cell { position: relative; }
.recipe-tree-rails {
    position: absolute;
    inset-block: 0 -1px;
    inset-inline-start: var(--pad-x);
    display: flex;
    pointer-events: none;
}
.recipe-tree-rail { flex: none; position: relative; width: var(--step); }
.recipe-tree-rail[data-folded] { width: 0; }
.recipe-tree-stem, .recipe-tree-arm, .recipe-tree-trunk {
    position: absolute;
    display: block;
    background: var(--rail-color);
    pointer-events: none;
}
.recipe-tree-stem { inset-block: 0; inset-inline-start: var(--pivot); width: 2px; }
.recipe-tree-arm {
    inset-block-start: var(--joint);
    inset-inline-start: var(--pivot);
    width: var(--step);
    height: 2px;
}
.recipe-tree-rail[data-line="elbow"] .recipe-tree-stem { inset-block-end: auto; height: calc(var(--joint) + 2px); }
.recipe-tree-rail[data-line="through"] .recipe-tree-arm,
.recipe-tree-rail[data-line="blank"] > * { display: none; }
.recipe-tree-trunk {
    inset-block: var(--joint) -1px;
    inset-inline-start: calc(var(--pad-x) + var(--lanes) * var(--step) + var(--pivot));
    width: 2px;
}
.recipe-tree-content {
    position: relative;
    min-width: 0;
    margin-inline-start: calc(var(--lanes) * var(--step));
}
.recipe-table-action {
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
}
.recipe-tree-identity {
    display: flex;
    align-items: flex-start;
    gap: var(--gap);
    width: fit-content;
    min-width: 0;
    max-width: 100%;
    text-align: start;
    color: #203f35;
    border-radius: 4px;
}
.recipe-tree-identity:is(button) { padding: 0; border: 0; background: transparent; font: inherit; }
.recipe-tree-identity:is(button):hover .recipe-table-name { color: #18644a; text-decoration: underline; text-underline-offset: 3px; }
.recipe-tree-chevron {
    display: grid;
    flex: none;
    place-items: center;
    width: var(--toggle);
    height: var(--toggle);
    margin-top: calc((var(--art) - var(--toggle)) / 2);
    color: #345f4b;
    font: 700 15px/1 var(--sans);
}
button.recipe-tree-identity .recipe-tree-chevron {
    border: 1px solid #adc2b1;
    border-radius: 4px;
    background: #f7fbf1;
}
button.recipe-tree-identity[aria-expanded="true"] .recipe-tree-chevron,
button.recipe-tree-identity:hover .recipe-tree-chevron { color: #fffbed; background: #47765e; border-color: #47765e; }
.recipe-tree-identity:not(button) .recipe-tree-chevron:empty {
    width: 6px;
    height: 6px;
    margin: calc(var(--art) / 2 - 2px) calc(var(--pivot) - 3px) 0;
    border-radius: 50%;
    background: #899d8d;
}
.pet-art.recipe-table-art {
    width: var(--art);
    height: var(--art);
    border: 1px solid #cdd6c4;
    border-radius: 6px;
    background: #f6f4e5;
}
.recipe-table-art .art-placeholder { font-size: 8px; }
.recipe-tree-labels {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1px 6px;
    align-self: center;
    min-width: 0;
}
.recipe-table-name {
    order: -1;
    flex: 0 0 100%;
    min-width: 0;
    font: 750 16px/1.35 var(--sans);
    overflow-wrap: anywhere;
}
[data-side="root"] .recipe-table-name { color: #1f4939; font-size: 18px; }
.recipe-tree-role, .recipe-table-grade, .recipe-tree-leaf { font-size: 11px; line-height: 1.45; }
.recipe-tree-role {
    padding: 0 4px; border-radius: 3px;
    font-size: 12px; font-weight: 700; color: #3c604b; background: #e8efe4;
}
[data-side="sub"] .recipe-tree-role { color: #795126; background: #f6edda; }
.recipe-table-grade, .recipe-tree-leaf { color: #606e62; }
.recipe-tree-parent, .recipe-tree-note, .recipe-table-select {
    display: block;
    margin-block-start: 4px;
    margin-inline-start: var(--tail-offset);
    max-width: calc(100% - var(--tail-offset));
    text-align: start;
}
.recipe-tree-parent, .recipe-tree-retry {
    color: #45654f;
    font-size: 12px;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: #92ad98;
    overflow-wrap: anywhere;
}
.recipe-tree-parent:hover, .recipe-tree-retry:hover { color: #1f6145; text-decoration-color: currentColor; }
.recipe-tree-note { color: #75603d; font-size: 12px; line-height: 1.5; font-weight: 400; }
.recipe-tree-retry { margin-inline-start: 5px; }
.recipe-table-select {
    width: auto;
    min-width: 0;
    min-height: 28px;
    padding: 2px 5px;
    border: 1px solid #b6c8b7;
    border-radius: 4px;
    background: #fcfdf7;
    color: #325341;
    font-size: 12px;
    text-overflow: ellipsis;
}
.recipe-tree-base .recipe-tree-value, .recipe-tree-level > .recipe-tree-value {
    display: block;
    line-height: var(--art);
    font-variant-numeric: tabular-nums;
}
.recipe-tree-base .recipe-tree-value { color: #53675a; font-size: 16px; font-weight: 550; }
.recipe-tree-level > .recipe-tree-value { color: #245a42; font-size: 21px; font-weight: 750; }
.recipe-table-supplies { display: grid; gap: 1px; color: #775824; font-size: 12px; line-height: 1.45; }
.recipe-table-supplies > strong { color: #78531d; font-weight: 700; }
.recipe-table-supplies > span { overflow-wrap: anywhere; }

.recipe-table-tools { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; }
.recipe-table-find { display: flex; align-items: center; gap: 5px; min-width: 0; color: #465e4f; font-size: 12px; font-weight: 650; }
.recipe-table-find > span { flex: none; }
.recipe-table-query {
    width: 11em; height: 30px; min-width: 0; padding: 3px 6px;
    border: 1px solid #bccab8; border-radius: 4px; background: #fffef8; font-size: 12px;
}
.recipe-table-status { flex: none; color: #566b59; font-size: 11px; }
.recipe-table-tools .recipe-table-action {
    flex: none; width: 29px; height: 30px; border: 1px solid #c5d0c2; border-radius: 4px;
    background: #fcfdf7; color: #345b47; font: 650 18px/1 var(--sans);
}
.recipe-table-tools .recipe-table-action:disabled { opacity: .45; }

.pet-recipe-table[data-layout="narrow"] {
    --pad-x: 7px;
    --pad-y: 7px;
    --step: 15px;
    --art: 33px;
    --toggle: 16px;
    --gap: 4px;
}
.pet-recipe-table[data-layout="narrow"] col:first-child { width: 73%; }
.pet-recipe-table[data-layout="narrow"] col:nth-child(2) { width: 27%; }
.pet-recipe-table[data-layout="narrow"] thead th { padding-block: 6px; font-size: 12px; }
.pet-recipe-table[data-layout="narrow"] .recipe-table-name { font-size: 15px; }
.pet-recipe-table[data-layout="narrow"] [data-side="root"] .recipe-table-name { font-size: 16px; }
.pet-recipe-table[data-layout="narrow"] .recipe-tree-labels { gap: 1px 4px; }
.pet-recipe-table[data-layout="narrow"] .recipe-tree-chevron { font-size: 13px; }
.pet-recipe-table[data-layout="narrow"] .recipe-tree-parent,
.pet-recipe-table[data-layout="narrow"] .recipe-tree-note,
.pet-recipe-table[data-layout="narrow"] .recipe-table-select { margin-top: 3px; }
.recipe-tree-stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; font-variant-numeric: tabular-nums; }
.recipe-tree-caption { color: #5e6c60; font-size: 11px; line-height: 1.35; }
.recipe-tree-stat .recipe-tree-value { color: #4e6355; font-size: 13px; font-weight: 550; line-height: 1.35; }
.recipe-tree-stat + .recipe-tree-stat .recipe-tree-value { color: #245a42; font-size: 16px; font-weight: 750; }
.recipe-tree-stats .recipe-table-supplies { margin-top: 3px; font-size: 11px; }
.pet-recipe-table[data-layout="narrow"] .recipe-table-find { flex: 1; }
.pet-recipe-table[data-layout="narrow"] .recipe-table-query { width: 100%; }
