#panel-ranch {
    --ranch-ink: #193d42;
    --ranch-muted: #6d8180;
    --ranch-line: #d5e2dc;
    --ranch-paper: #fbfcf7;
    --ranch-sage: #4f8272;
    --ranch-sage-soft: #e8f1eb;
    --ranch-wheat: #b98c4d;
    --ranch-wheat-soft: #f6edda;
    color: var(--ranch-ink);
}

#panel-ranch * { box-sizing: border-box; }
#panel-ranch .ranch-v2 { display: grid; gap: 18px; width: min(100%, 1380px); margin: 0 auto; padding: 2px 0 30px; }

#panel-ranch .ranch-v2-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 1.2fr) minmax(420px, 1fr);
    gap: 30px;
    align-items: end;
    min-height: 230px;
    padding: clamp(24px, 4vw, 46px);
    overflow: hidden;
    border: 1px solid #cadbd3;
    border-radius: 26px 12px 26px 12px;
    background:
        radial-gradient(circle at 87% 16%, rgba(216, 190, 129, .28), transparent 28%),
        radial-gradient(circle at 6% 96%, rgba(95, 142, 124, .18), transparent 34%),
        #f3f7ef;
}

#panel-ranch .ranch-v2-hero::after {
    content: "";
    position: absolute;
    inset: auto -4% -48% auto;
    width: 330px;
    aspect-ratio: 1;
    border: 1px solid rgba(79, 130, 114, .18);
    border-radius: 50%;
    box-shadow: 0 0 0 32px rgba(79, 130, 114, .04), 0 0 0 66px rgba(79, 130, 114, .035);
    pointer-events: none;
}

#panel-ranch .ranch-v2-hero > div:first-child { position: relative; z-index: 1; max-width: 660px; }
#panel-ranch .ranch-v2-hero small,
#panel-ranch .ranch-v2-section > header small,
#panel-ranch .ranch-v2-gate small,
#panel-ranch .ranch-v2-expand small,
#panel-ranch .ranch-v2-control small { color: #638379; font-size: 9px; font-weight: 900; letter-spacing: .13em; }
#panel-ranch .ranch-v2-hero h2 { margin: 8px 0 10px; font-size: clamp(30px, 4.6vw, 58px); line-height: .96; letter-spacing: -.06em; text-wrap: balance; }
#panel-ranch .ranch-v2-hero p { max-width: 58ch; margin: 0; color: #607772; font-size: 12px; line-height: 1.75; text-wrap: pretty; }

#panel-ranch .ranch-v2-hero__stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid rgba(101, 134, 120, .22); border-radius: 15px; background: rgba(101, 134, 120, .2); }
#panel-ranch .ranch-v2-hero__stats > div { display: grid; gap: 6px; min-height: 86px; align-content: center; padding: 15px; background: rgba(255, 255, 251, .82); backdrop-filter: blur(8px); }
#panel-ranch .ranch-v2-hero__stats small { color: #758780; font-size: 9px; font-weight: 750; letter-spacing: 0; }
#panel-ranch .ranch-v2-hero__stats strong { color: #274f4b; font-size: clamp(16px, 2vw, 23px); font-variant-numeric: tabular-nums; }

#panel-ranch .ranch-v2-profile-warning,
#panel-ranch .ranch-v2-expand,
#panel-ranch .ranch-v2-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 17px 19px; border: 1px solid var(--ranch-line); border-radius: 15px; background: #fff; }
#panel-ranch .ranch-v2-profile-warning { grid-template-columns: minmax(0, 1fr) auto; border-color: #e1cfa9; background: #fbf5e8; }
#panel-ranch .ranch-v2-profile-warning strong,
#panel-ranch .ranch-v2-profile-warning span { display: block; }
#panel-ranch .ranch-v2-profile-warning span { margin-top: 4px; color: #7b715d; font-size: 10px; }

#panel-ranch button { font-family: inherit; transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease; }
#panel-ranch button:not(:disabled) { cursor: pointer; }
#panel-ranch button:not(:disabled):hover { transform: translateY(-1px); }
#panel-ranch button:not(:disabled):active { transform: translateY(1px); }
#panel-ranch button:focus-visible,
#panel-ranch input:focus-visible { outline: 3px solid rgba(70, 128, 108, .28); outline-offset: 2px; }
#panel-ranch button:disabled { cursor: not-allowed; opacity: .46; }

#panel-ranch .ranch-v2-profile-warning button,
#panel-ranch .ranch-v2-gate button,
#panel-ranch .ranch-v2-expand button,
#panel-ranch .ranch-v2-control > button,
#panel-ranch .ranch-v2-catalog-card > button {
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid #477a6b;
    border-radius: 10px;
    color: #fff;
    background: #4f8272;
    font-size: 10px;
    font-weight: 850;
}

#panel-ranch .ranch-v2-gate { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, .8fr) auto; gap: 22px; align-items: center; padding: 24px; border: 1px solid #d9dfce; border-radius: 18px; background: var(--ranch-paper); }
#panel-ranch .ranch-v2-gate h3 { margin: 6px 0; font-size: 24px; letter-spacing: -.04em; }
#panel-ranch .ranch-v2-gate p { max-width: 54ch; margin: 0; color: var(--ranch-muted); font-size: 10px; line-height: 1.65; }
#panel-ranch .ranch-v2-gate dl,
#panel-ranch .ranch-v2-control dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
#panel-ranch .ranch-v2-gate dl > div,
#panel-ranch .ranch-v2-control dl > div { padding: 10px; border: 1px solid #dde6e0; border-radius: 10px; background: #fff; }
#panel-ranch .ranch-v2-gate dl > div.is-ready { border-color: #a8c9bb; background: #edf6f1; }
#panel-ranch dt { color: #7b8a86; font-size: 8px; font-weight: 750; }
#panel-ranch dd { margin: 3px 0 0; color: #294f4d; font-size: 11px; font-weight: 850; font-variant-numeric: tabular-nums; }

#panel-ranch .ranch-v2-control { grid-template-columns: minmax(230px, 1fr) minmax(350px, 1fr) auto; background: #f9fbf7; }
#panel-ranch .ranch-v2-control > div > strong,
#panel-ranch .ranch-v2-control > div > span { display: block; }
#panel-ranch .ranch-v2-control > div > strong { margin: 5px 0; font-size: 16px; }
#panel-ranch .ranch-v2-control > div > span { max-width: 52ch; color: var(--ranch-muted); font-size: 9px; line-height: 1.55; }
#panel-ranch .ranch-v2-maxed { justify-self: end; color: #4d786c; font-size: 11px; }

#panel-ranch .ranch-v2-section { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--ranch-line); border-radius: 20px 10px 20px 10px; background: rgba(255, 255, 252, .94); }
#panel-ranch .ranch-v2-section > header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 13px; border-bottom: 1px solid #e1e9e4; }
#panel-ranch .ranch-v2-section > header h3 { margin: 5px 0 0; font-size: clamp(19px, 2.4vw, 28px); letter-spacing: -.045em; }
#panel-ranch .ranch-v2-section > header > span { max-width: 62ch; color: var(--ranch-muted); font-size: 10px; line-height: 1.55; text-align: right; }
#panel-ranch .ranch-v2-feed-all { display: inline-block; margin-left: 12px; min-height: 30px; padding: 6px 16px; border: 1px solid #548677; border-radius: 9px; color: #fff; background: #548677; font-size: 10px; font-weight: 800; letter-spacing: .04em; cursor: pointer; vertical-align: middle; }
#panel-ranch .ranch-v2-feed-all:hover { filter: brightness(1.08); }

#panel-ranch .ranch-v2-expand > div > strong,
#panel-ranch .ranch-v2-expand > div > span { display: block; }
#panel-ranch .ranch-v2-expand > div > strong { margin: 4px 0; font-size: 14px; }
#panel-ranch .ranch-v2-expand > div > span { color: var(--ranch-muted); font-size: 9px; }

#panel-ranch .ranch-v2-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#panel-ranch .ranch-v2-slot { display: grid; gap: 13px; min-width: 0; padding: 15px; border: 1px solid #d7e3de; border-radius: 15px; background: #f9fbf7; }
#panel-ranch .ranch-v2-slot.is-induce,
#panel-ranch .ranch-v2-slot.is-harvest { border-color: #d6bf8c; background: #fcf7e9; }
#panel-ranch .ranch-v2-slot.is-empty { min-height: 210px; align-content: space-between; border-style: dashed; background: #fafbf8; }
#panel-ranch .ranch-v2-slot > header { display: flex; justify-content: space-between; gap: 10px; }
#panel-ranch .ranch-v2-slot > header span { color: #71847f; font-size: 9px; font-weight: 800; }
#panel-ranch .ranch-v2-slot > header b { color: #52766d; font-size: 9px; }
#panel-ranch .ranch-v2-animal { display: flex; align-items: center; gap: 13px; }
#panel-ranch .ranch-v2-animal__image,
#panel-ranch .ranch-v2-fallback { width: 78px; height: 78px; flex: 0 0 78px; object-fit: contain; border-radius: 14px; background: #eef4ec; }
#panel-ranch .ranch-v2-fallback { display: grid; place-items: center; color: #5c7b72; font-size: 28px; font-weight: 900; }
#panel-ranch .ranch-v2-animal > div { display: grid; gap: 4px; min-width: 0; }
#panel-ranch .ranch-v2-animal strong { font-size: 17px; }
#panel-ranch .ranch-v2-animal span { color: #71847f; font-size: 9px; }
#panel-ranch .ranch-v2-cycle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #dbe6e1; border-radius: 11px; background: #dbe6e1; }
#panel-ranch .ranch-v2-cycle > div { display: grid; gap: 4px; align-content: start; min-width: 0; min-height: 92px; padding: 10px; background: #fff; }
#panel-ranch .ranch-v2-cycle small { color: #7d8f8a; font-size: 8px; }
#panel-ranch .ranch-v2-cycle strong { color: #30564f; font-size: 10px; line-height: 1.4; font-variant-numeric: tabular-nums; }
#panel-ranch .ranch-v2-cycle span { color: #7b8c88; font-size: 8px; line-height: 1.4; }
#panel-ranch .ranch-v2-cycle .ranch-v2-yield-steps { display: block; padding-top: 4px; border-top: 1px dashed #dbe6e1; color: #4f6f68; font-size: 9px; line-height: 1.6; font-variant-numeric: tabular-nums; }
#panel-ranch .ranch-v2-cycle .ranch-v2-yield-steps i { color: #9aaba7; font-style: normal; }
#panel-ranch .ranch-v2-cycle .ranch-v2-yield-steps em { color: #2f7a63; font-style: normal; font-weight: 800; }
#panel-ranch .ranch-v2-slot footer { display: flex; flex-wrap: wrap; gap: 7px; }
#panel-ranch .ranch-v2-slot footer button { min-height: 36px; padding: 7px 10px; border: 1px solid #cddbd6; border-radius: 9px; color: #4f6f68; background: #fff; font-size: 9px; font-weight: 800; }
#panel-ranch .ranch-v2-slot footer button:first-child { margin-right: auto; border-color: #548677; color: #fff; background: #548677; }
#panel-ranch .ranch-v2-empty-slot { display: grid; gap: 5px; justify-items: center; align-content: center; text-align: center; }
#panel-ranch .ranch-v2-empty-slot::before { content: "+"; display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 4px; border: 1px solid #c7d8d1; border-radius: 50%; color: #6c8d83; font-size: 23px; }
#panel-ranch .ranch-v2-empty-slot strong { font-size: 12px; }
#panel-ranch .ranch-v2-empty-slot span { max-width: 38ch; color: var(--ranch-muted); font-size: 9px; line-height: 1.5; }

#panel-ranch .ranch-v2-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
#panel-ranch .ranch-v2-catalog-card { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px 13px; min-width: 0; padding: 13px; border: 1px solid #dae5df; border-radius: 14px; background: #fafbf8; }
#panel-ranch .ranch-v2-catalog-card__image { width: 82px; height: 102px; grid-row: 1 / span 2; object-fit: contain; border-radius: 12px; background: #edf3eb; }
#panel-ranch .ranch-v2-catalog-card__copy { display: grid; gap: 4px; min-width: 0; align-content: start; }
#panel-ranch .ranch-v2-catalog-card__copy > small { color: #66877d; font-size: 8px; font-weight: 850; }
#panel-ranch .ranch-v2-catalog-card__copy > strong { font-size: 15px; }
#panel-ranch .ranch-v2-catalog-card__copy > p { display: -webkit-box; margin: 0; overflow: hidden; color: #7b8a86; font-size: 8px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#panel-ranch .ranch-v2-catalog-card__copy > span { display: flex; align-items: center; gap: 5px; color: #3e665e; font-size: 9px; font-weight: 750; }
#panel-ranch .ranch-v2-catalog-card__copy > em { color: #778985; font-size: 8px; font-style: normal; line-height: 1.5; }
#panel-ranch .ranch-v2-product-icon { width: 24px; height: 24px; object-fit: contain; border-radius: 6px; background: #eef3ec; }
#panel-ranch .ranch-v2-catalog-card__meta { display: flex; justify-content: space-between; gap: 8px; grid-column: 2; color: #6f807c; font-size: 8px; font-variant-numeric: tabular-nums; }
#panel-ranch .ranch-v2-catalog-card > button { grid-column: 1 / -1; width: 100%; }

#panel-ranch .ranch-v2-rate { display: grid; grid-template-columns: auto auto minmax(200px, 1fr); gap: 16px; align-items: center; padding: 13px; border: 1px solid #dfdfce; border-radius: 13px; background: #fbf8ed; }
#panel-ranch .ranch-v2-rate > strong { font-size: 11px; }
#panel-ranch .ranch-v2-rate > div { display: flex; gap: 5px; }
#panel-ranch .ranch-v2-rate button { min-width: 56px; min-height: 34px; border: 1px solid #d7c89f; border-radius: 8px; color: #806d43; background: #fffdf7; font-size: 9px; font-weight: 850; }
#panel-ranch .ranch-v2-rate button.is-active { border-color: #b58b49; color: #fff; background: #b58b49; }
#panel-ranch .ranch-v2-rate > span { justify-self: end; color: #7d786b; font-size: 9px; text-align: right; }
#panel-ranch .ranch-v2-inventory { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
#panel-ranch .ranch-v2-inventory-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 13px; border: 1px solid #dde5dc; border-radius: 13px; background: #fbfcf8; }
#panel-ranch .ranch-v2-inventory-card__image { width: 64px; height: 64px; grid-row: 1 / span 2; object-fit: contain; border-radius: 11px; background: #edf3eb; }
#panel-ranch .ranch-v2-inventory-card > div:not(.ranch-v2-inventory-actions) { display: grid; gap: 3px; }
#panel-ranch .ranch-v2-inventory-card strong { font-size: 13px; }
#panel-ranch .ranch-v2-inventory-card span,
#panel-ranch .ranch-v2-inventory-card small { color: #788884; font-size: 8px; }
#panel-ranch .ranch-v2-inventory-card label { display: grid; grid-template-columns: auto minmax(70px, 1fr); grid-column: 2; gap: 8px; align-items: center; color: #71817d; font-size: 9px; }
#panel-ranch .ranch-v2-inventory-card input { width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid #cfddd7; border-radius: 8px; color: var(--ranch-ink); background: #fff; font: inherit; font-variant-numeric: tabular-nums; }
#panel-ranch .ranch-v2-inventory-actions { display: grid; grid-template-columns: 1fr 1fr; grid-column: 1 / -1; gap: 7px; }
#panel-ranch .ranch-v2-inventory-actions button { min-height: 38px; border: 1px solid #ccd9d4; border-radius: 9px; color: #55736b; background: #fff; font-size: 9px; font-weight: 800; }
#panel-ranch .ranch-v2-inventory-actions button:last-child { border-color: #b88c4b; color: #fff; background: #b88c4b; }
#panel-ranch .ranch-v2-empty { grid-column: 1 / -1; display: grid; gap: 5px; justify-items: center; min-height: 160px; align-content: center; border: 1px dashed #cad9d2; border-radius: 14px; color: #71827d; text-align: center; }
#panel-ranch .ranch-v2-empty strong { color: #355a53; font-size: 13px; }
#panel-ranch .ranch-v2-empty span { font-size: 9px; }

#panel-ranch .ranch-v2-route-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
#panel-ranch .ranch-v2-route-grid > article { display: grid; gap: 9px; min-width: 0; padding: 13px; border-top: 3px solid #769687; background: #f4f7f0; }
#panel-ranch .ranch-v2-route-grid small { color: #74847f; font-size: 8px; font-weight: 800; }
#panel-ranch .ranch-v2-route-grid strong { font-size: 14px; }
#panel-ranch .ranch-v2-route-grid dl { display: grid; gap: 5px; margin: 0; }
#panel-ranch .ranch-v2-route-grid dl > div { display: flex; justify-content: space-between; gap: 8px; }
#panel-ranch .ranch-v2-route-grid p { margin: 0; color: #71817d; font-size: 8px; line-height: 1.55; }
#panel-ranch .ranch-v2-rules { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
#panel-ranch .ranch-v2-rules article { display: grid; gap: 5px; padding: 12px; border: 1px solid #dce5df; border-radius: 11px; background: #fff; }
#panel-ranch .ranch-v2-rules strong { font-size: 10px; }
#panel-ranch .ranch-v2-rules span { color: #72827e; font-size: 8px; line-height: 1.55; }

@media (max-width: 1100px) {
    #panel-ranch .ranch-v2-hero { grid-template-columns: 1fr; }
    #panel-ranch .ranch-v2-gate,
    #panel-ranch .ranch-v2-control { grid-template-columns: 1fr 1fr; }
    #panel-ranch .ranch-v2-gate > button,
    #panel-ranch .ranch-v2-control > button,
    #panel-ranch .ranch-v2-maxed { grid-column: 1 / -1; width: 100%; justify-self: stretch; }
    #panel-ranch .ranch-v2-route-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #panel-ranch .ranch-v2-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    #panel-ranch .ranch-v2 { gap: 13px; padding-bottom: 18px; }
    #panel-ranch .ranch-v2-hero { min-height: 0; gap: 22px; padding: 22px 15px 16px; border-radius: 18px 8px 18px 8px; }
    #panel-ranch .ranch-v2-hero h2 { font-size: 34px; }
    #panel-ranch .ranch-v2-hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #panel-ranch .ranch-v2-hero__stats > div { min-height: 74px; padding: 12px; }
    #panel-ranch .ranch-v2-profile-warning,
    #panel-ranch .ranch-v2-gate,
    #panel-ranch .ranch-v2-control,
    #panel-ranch .ranch-v2-expand { grid-template-columns: minmax(0, 1fr); padding: 14px; }
    #panel-ranch .ranch-v2-profile-warning button,
    #panel-ranch .ranch-v2-gate button,
    #panel-ranch .ranch-v2-expand button,
    #panel-ranch .ranch-v2-control > button { width: 100%; }
    #panel-ranch .ranch-v2-gate dl,
    #panel-ranch .ranch-v2-control dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #panel-ranch .ranch-v2-section { gap: 12px; padding: 14px 12px; border-radius: 16px 8px 16px 8px; }
    #panel-ranch .ranch-v2-section > header { display: grid; gap: 7px; }
    #panel-ranch .ranch-v2-section > header > span { max-width: none; text-align: left; }
    #panel-ranch .ranch-v2-slots,
    #panel-ranch .ranch-v2-catalog,
    #panel-ranch .ranch-v2-inventory,
    #panel-ranch .ranch-v2-route-grid,
    #panel-ranch .ranch-v2-rules { grid-template-columns: minmax(0, 1fr); }
    #panel-ranch .ranch-v2-cycle { grid-template-columns: 1fr; }
    #panel-ranch .ranch-v2-cycle > div { min-height: 70px; }
    #panel-ranch .ranch-v2-slot footer { display: grid; grid-template-columns: 1fr 1fr; }
    #panel-ranch .ranch-v2-slot footer button:first-child { grid-column: 1 / -1; width: 100%; margin: 0; }
    #panel-ranch .ranch-v2-catalog-card { grid-template-columns: 72px minmax(0, 1fr); }
    #panel-ranch .ranch-v2-catalog-card__image { width: 72px; height: 94px; }
    #panel-ranch .ranch-v2-rate { grid-template-columns: 1fr; gap: 9px; }
    #panel-ranch .ranch-v2-rate > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #panel-ranch .ranch-v2-rate button { width: 100%; }
    #panel-ranch .ranch-v2-rate > span { justify-self: start; text-align: left; }
    #panel-ranch .ranch-v2-inventory-card { grid-template-columns: 58px minmax(0, 1fr); }
    #panel-ranch .ranch-v2-inventory-card__image { width: 58px; height: 58px; }
    #panel-ranch .ranch-v2-inventory-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    #panel-ranch button { transition: none; }
}
