/* --- Globális és Konténer --- */
.rgf-container {
    max-width: 1280px;
    margin: 20px auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #0f172a;
}
/* --- Recept Rács (Grid) --- */
.rg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.rg-card { background: #fff; border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.08); overflow: hidden; transition: transform .2s, box-shadow .2s; position: relative; color: inherit; text-decoration: none; }
.rg-card:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.rg-card-link { display:block; text-decoration:none; color:inherit; }
.rg-card-image { width:100%; height:180px; object-fit:cover; display:block; }
.rg-card-content { padding:16px 20px 20px; }
.rg-card-title { font-size:20px; font-weight:600; margin:0 0 8px; }
.rg-card-desc { font-size:15px; color:#64748b; line-height:1.5; height:3em; overflow:hidden; text-overflow:ellipsis; }
/* Favorite */
.rg-favorite-toggle{ position:absolute; top:12px; right:12px; z-index:2; background:rgba(255,255,255,.8); border:none; border-radius:50%; width:40px; height:40px; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:24px; color:#94a3b8; backdrop-filter:blur(4px); transition:color .2s; }
.rg-favorite-toggle:hover{ color:#0f172a; } .rg-favorite-toggle.is-favorite{ color:#f59e0b; }
.rg-favorite-toggle.rgf-disabled{ cursor:not-allowed; color:#cbd5e1; }
.rg-favorite-toggle.rgf-disabled:hover::after{ content:attr(data-tooltip); position:absolute; top:110%; right:0; background:#333; color:#fff; font-size:12px; padding:4px 8px; border-radius:4px; white-space:nowrap; }
/* Detail */
.rg-detail-hero{ display:grid; grid-template-columns:1fr 1fr; gap:32px; align-items:center; margin-bottom:32px; }
.rg-detail-image{ width:100%; height:auto; border-radius:20px; max-height:450px; object-fit:cover; }
.rg-detail-title{ font-size:36px; font-weight:700; margin:0 0 16px; }
.rg-detail-desc{ font-size:18px; color:#64748b; line-height:1.6; }
/* Étkezés Választó */
.rg-meal-selector{ display:flex; flex-wrap:wrap; gap:12px; margin-bottom:24px; background:#f1f5f9; padding:16px; border-radius:12px; }
.rg-meal-selector label{ display:inline-block; padding:10px 16px; background:#fff; border:1px solid #e2e8f0; border-radius:8px; cursor:pointer; transition:background .2s,border-color .2s; font-size:15px; font-weight:500; }
.rg-meal-selector input[type="radio"]{ display:none; }
.rg-meal-selector input[type="radio"]:checked + label{ background:#0ea5b6; color:#fff; border-color:#0ea5b6; }
.rg-meal-selector input[type="radio"]:disabled + label{ background:#f8fafc; color:#cbd5e1; cursor:not-allowed; }
/* Table & Summary */
.rg-detail-layout{ display:grid; grid-template-columns:2fr 1fr; gap:24px; }
.rg-ingredients-table{ width:100%; border-collapse:collapse; }
.rg-ingredients-table th,.rg-ingredients-table td{ text-align:left; padding:12px 16px; border-bottom:1px solid #e2e8f0; font-size:15px; }
.rg-ingredients-table th{ background:#f8fafc; font-weight:600; color:#64748b; }
.rg-summary-card{ background:#fff; border-radius:16px; padding:24px; box-shadow:0 6px 20px rgba(0,0,0,.08); align-self:flex-start; }
.rg-summary-card h3{ font-size:20px; margin:0 0 16px; border-bottom:1px solid #e2e8f0; padding-bottom:12px; }
.rg-summary-row{ display:flex; justify-content:space-between; font-size:16px; margin-bottom:8px; }
.rg-summary-row span:first-child{ font-weight:500; color:#64748b; }
.rg-summary-row span:last-child{ font-weight:600; color:#0f172a; }
#rg-suggestion-card{ margin-top:16px; background:#fffbeb; border:1px solid #fde68a; display:none; }
#rg-suggestion-card h3{ color:#b45309; border-bottom-color:#fde68a; }
#rg-suggestion-list li{ color:#b45309; font-weight:500; margin-bottom:4px; }
/* Responsive */
@media (max-width:1024px){ .rg-grid{ grid-template-columns:repeat(2,1fr);} .rg-detail-layout{ grid-template-columns:1fr;} .rg-summary-card{ order:-1; margin-bottom:24px;} }
@media (max-width:767px){ .rg-detail-hero{ grid-template-columns:1fr;} .rg-detail-image{ order:-1;} .rg-ingredients-table thead{ display:none;} .rg-ingredients-table tr{ display:block; margin-bottom:16px; border:1px solid #e2e8f0; border-radius:8px; overflow:hidden;} .rg-ingredients-table td{ display:block; text-align:right; padding-left:50%; position:relative; border-bottom:1px solid #e2e8f0;} .rg-ingredients-table td:last-child{ border-bottom:none;} .rg-ingredients-table td::before{ content:attr(data-label); position:absolute; left:16px; text-align:left; font-weight:600; color:#64748b;} }
@media (max-width:640px){ .rg-grid{ grid-template-columns:1fr;} .rg-card-image{ height:200px;} }


/* --- Tiny "Vissza" link button (detail page) --- */
.rg-back-small{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:14px;
    padding:6px 10px;
    background:#f1f5f9;
    border:1px solid #e2e8f0;
    border-radius:8px;
    text-decoration:none;
    color:#0f172a;
    margin-bottom:8px;
}
.rg-back-small:hover{ background:#e2e8f0; border-color:#cbd5e1; }


/* --- Mobil táblázat fix: maradjon két oszlopos / több oszlopos elrendezés --- */
@media (max-width: 767px) {
    .rg-ingredients-table {
        display: table;
        width: 100%;
    }
    .rg-ingredients-table thead {
        display: table-header-group;
    }
    .rg-ingredients-table tbody {
        display: table-row-group;
    }
    .rg-ingredients-table tr {
        display: table-row;
    }
    .rg-ingredients-table th,
    .rg-ingredients-table td {
        display: table-cell;
        padding: 8px 10px;
    }
    .rg-ingredients-table td::before {
        content: none !important;
    }

    /* Összesen sor mobilon: mutassuk a szöveges címkéket */
    .rg-ingredients-detail .rg-detail-total .rg-total-label {
        display: inline-block;
        font-weight: 600;
        margin-right: 4px;
    }
}

/* Asztali / nagyobb nézet: ne látszódjanak a plusz címkék az Összesen sorban */
@media (min-width: 768px) {
    .rg-ingredients-detail .rg-detail-total .rg-total-label {
        display: none;
    }
}


/* --- Mobilos táblázat finomhangolás: ne csússzanak ki, fejléc törhet --- */
@media (max-width: 767px) {

    .rg-table-wrapper {
        overflow-x: auto;
    }

    .rg-ingredients-table {
        table-layout: fixed;
    }

    .rg-ingredients-table th,
    .rg-ingredients-table td {
        white-space: normal;
        word-break: break-word;
    }

    /* Egyszerű hozzávaló táblázat: 2 oszlop */
    .rg-ingredients-basic th:nth-child(1),
    .rg-ingredients-basic td:nth-child(1) {
        width: 50%;
    }
    .rg-ingredients-basic th:nth-child(2),
    .rg-ingredients-basic td:nth-child(2) {
        width: 24%;
        text-align: left;
    }
    .rg-ingredients-basic th:nth-child(3),
    .rg-ingredients-basic td:nth-child(3) {
        width: 26%;
        text-align: left;
    }

    /* Részletező táblázat: 1 széles + 5 szűk oszlop */
    .rg-ingredients-detail th:nth-child(1),
    .rg-ingredients-detail td:nth-child(1) {
        width: 34%;
    }
    .rg-ingredients-detail th:nth-child(2),
    .rg-ingredients-detail th:nth-child(3),
    .rg-ingredients-detail th:nth-child(4),
    .rg-ingredients-detail th:nth-child(5),
    .rg-ingredients-detail th:nth-child(6),
    .rg-ingredients-detail td:nth-child(2),
    .rg-ingredients-detail td:nth-child(3),
    .rg-ingredients-detail td:nth-child(4),
    .rg-ingredients-detail td:nth-child(5),
    .rg-ingredients-detail td:nth-child(6) {
        width: 13%;
        text-align: right;
    }

    .rg-ingredients-detail th,
    .rg-ingredients-detail td {
        font-size: 12px;
        padding: 6px 4px;
    }
}


/* --- Az én tányérom: alkalmazás / visszavonás gombok --- */
.rg-myplate-item{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding:10px 0;
    border-top:1px solid #e2e8f0;
}
.rg-myplate-item:first-child{ border-top:none; }
.rg-myplate-text{ flex:1; }
.rg-myplate-delta{ color:#ef4444; font-weight:700; }

.rg-myplate-action-btn{
    display:inline-block;
    padding:10px 16px;
    border:1px solid #cbd5e1;
    border-radius:12px;
    background:#fff;
    cursor:pointer;
    transition:background .2s,border-color .2s;
    font-size:15px;
    font-weight:500;
    white-space:nowrap;
}
.rg-myplate-action-btn:hover{
    border-color:#94a3b8;
}
.rg-myplate-action-btn.is-applied{
    background:#0ea5b6;
    color:#fff;
    border-color:#0ea5b6;
}

#rg-myplate-card{ margin-bottom:16px; }

@media (max-width: 767px){
    .rg-myplate-action-btn{
        padding:8px 12px;
        font-size:13px;
    }
}


/* MyPlate - Csere gomb + akciók */
.rg-myplate-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

@media (max-width: 768px){
  .rg-myplate-actions{ flex-direction:column; align-items:stretch; }
  .rg-myplate-actions button{ width:100%; }
}

.rg-myplate-swap-btn{
  padding:10px 14px;
  border-radius:10px;
  border:1px solid #e2e8f0;
  background:#f8fafc;
  font-weight:600;
  cursor:pointer;
}

.rg-myplate-swap-btn:hover{
  filter:brightness(0.98);
}

/* MyPlate - Csere modal */
#rg-myplate-swap-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
}
#rg-myplate-swap-modal[hidden]{ display:none; }

.rg-myplate-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.35);
}

.rg-myplate-modal{
  position:relative;
  width:min(560px, 92vw);
  max-height:80vh;
  background:#fff;
  border-radius:14px;
  box-shadow:0 12px 40px rgba(0,0,0,0.25);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.rg-myplate-modal-header{
  padding:14px 16px;
  border-bottom:1px solid #e2e8f0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.rg-myplate-modal-header h4{
  margin:0;
  font-size:16px;
}

.rg-myplate-modal-body{
  padding:12px 16px;
  overflow:auto;
}

.rg-myplate-modal-search{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #e2e8f0;
  margin-bottom:10px;
}

.rg-myplate-swap-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.rg-myplate-swap-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid #e2e8f0;
  border-radius:12px;
  background:#fff;
}

.rg-myplate-swap-item button{
  padding:8px 12px;
  border-radius:10px;
  border:1px solid #e2e8f0;
  background:#f1f5f9;
  font-weight:600;
  cursor:pointer;
}

.rg-myplate-extra{
  opacity:0.95;
}

.rg-myplate-extra td:first-child::after{
  content:" (plusz)";
  font-size:12px;
  color:#64748b;
}

/* === MyPlate gombok (csak stílus felülírás) === */
/* Alkalmazom: egyezzen az étkezésválasztó aktív gombjával */
#rg-myplate-card .rg-myplate-action-btn{
  background:#0ea5b6 !important;
  color:#fff !important;
  border-color:#0ea5b6 !important;
}
#rg-myplate-card .rg-myplate-action-btn:hover{
  filter: brightness(0.96);
}

/* Visszavonás (is-applied): szép szürkés */
#rg-myplate-card .rg-myplate-action-btn.is-applied{
  background:#e2e8f0 !important;
  color:#334155 !important;
  border-color:#cbd5e1 !important;
}
#rg-myplate-card .rg-myplate-action-btn.is-applied:hover{
  filter: brightness(0.98);
}

/* Csere gomb: világos kék */
#rg-myplate-card .rg-myplate-swap-btn{
  background:#0284c7 !important;
  color:#fff !important;
  border-color:#0284c7 !important;
}
#rg-myplate-card .rg-myplate-swap-btn:hover{
  background:#0369a1 !important;
  border-color:#0369a1 !important;
}

/* Csere modalban a "Választom" gomb */
#rg-myplate-card .rg-myplate-swap-pick{
  background:#0284c7 !important;
  color:#fff !important;
  border:1px solid #0284c7 !important;
  border-radius:10px;
  padding:10px 14px;
  font-weight:700;
  cursor:pointer;
}
#rg-myplate-card .rg-myplate-swap-pick:hover{
  background:#0369a1 !important;
  border-color:#0369a1 !important;
}


/* --- Adagoló (1–99) a Hozzávalók cím mellett --- */
.rg-ingredients-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.rg-servings-stepper{display:flex;align-items:center;gap:8px;}
.rg-servings-stepper .rg-servings-label{font-size:14px;opacity:.8;}
.rg-servings-stepper .rg-step-btn{
display:inline-flex;align-items:center;justify-content:center;min-width:40px;height:40px;padding:0 12px;border:1px solid #cbd5e1;border-radius:12px;background:#f8fafc;cursor:pointer;font-weight:700;
    border: 1px solid #0284c7;
    background: #0284c7;
    color: #fff;
}

.rg-servings-stepper .rg-step-btn:active{transform:translateY(1px);}
#rg-servings-input{
width:64px;height:40px;text-align:center;padding:8px 10px;border:1px solid #cbd5e1;border-radius:12px;background:#ffffff;font-weight:700;
    border: 1px solid #0284c7;
}

@media (max-width:520px){#rg-servings-input{width:56px;}}

/* MyPlate: Összes alkalmazása gomb spacing */
#rg-myplate-card .rg-myplate-applyall-btn{margin:10px 0 14px 0;}


/* Adagoló gomb hover (kék) */
.rg-servings-stepper .rg-step-btn:hover{
    background:#0369a1;
    border-color:#0369a1;
}

#rg-servings-input:focus{
    outline:none;
    box-shadow:0 0 0 3px rgba(2,132,199,0.25);
}


/* --- MyPlate mobil igazítás: gombok egymás alatt, ne lógjon ki --- */
@media (max-width: 520px){
  #rg-myplate-card .rg-myplate-item{
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:10px;
  }
  #rg-myplate-card .rg-myplate-text{ width:100%; }
  #rg-myplate-card .rg-myplate-action-btn,
  #rg-myplate-card .rg-myplate-swap-btn{
    width:100%;
  }
}


/* --- Adagoló mobil: kompakt és tördelhető --- */
@media (max-width: 520px){
  .rg-ingredients-header{ align-items:flex-start; }
  .rg-servings-stepper{ width:100%; justify-content:flex-start; }
  .rg-servings-stepper .rg-step-btn{ width:40px; height:40px; }
  #rg-servings-input{ width:56px; height:40px; }
}


/* --- Makróillesztés és kiegészítők --- */
.rg-fit-status{margin-top:16px;padding:14px 16px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc}
.rg-fit-status-badge{display:inline-flex;align-items:center;justify-content:center;padding:6px 12px;border-radius:999px;font-size:13px;font-weight:700;background:#e2e8f0;color:#0f172a;margin-bottom:10px}
.rg-fit-status-badge.is-good{background:#dcfce7;color:#166534}
.rg-fit-status-badge.is-near{background:#fef3c7;color:#92400e}
.rg-fit-status-badge.is-supplement{background:#fee2e2;color:#991b1b}
.rg-fit-status-text{margin:0;color:#475569;line-height:1.5}
.rg-target-summary,.rg-final-summary{margin-top:18px}
.rg-diff-summary{margin-top:18px;display:grid;gap:10px}
.rg-diff-item{padding:10px 12px;border-radius:10px;background:#f8fafc;color:#475569;font-size:14px}
.rg-diff-item.is-good{background:#ecfdf5;color:#166534}
.rg-diff-item.is-warn{background:#fff7ed;color:#9a3412}
.rg-diff-item.is-bad{background:#fef2f2;color:#991b1b}
.rg-ingredient-meta{display:block;margin-top:4px;font-size:12px;color:#94a3b8}
.rg-supplements-card{margin-top:24px}
.rg-supplement-group{margin-top:16px}
.rg-supplement-group label{display:block;margin-bottom:8px;font-weight:600}
.rg-supplement-group select{width:100%;padding:12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;font-size:15px}
.rg-supplement-help{margin:8px 0 0;color:#64748b;font-size:14px;line-height:1.5}
.rg-log-button{width:100%;padding:14px 16px;border:none;border-radius:12px;background:#0ea5b6;color:#fff;font-size:15px;font-weight:700;cursor:pointer;transition:opacity .2s}
.rg-log-button:hover{opacity:.92}
.rg-log-button.secondary{background:#e2e8f0;color:#0f172a}
.rg-log-feedback{margin-top:14px;padding:12px;border-radius:10px;background:#ecfeff;color:#155e75;font-size:14px;line-height:1.5}
.rg-log-modal[hidden]{display:none}
.rg-log-modal{position:fixed;inset:0;z-index:9999}
.rg-log-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.58)}
.rg-log-modal-card{position:relative;max-width:520px;margin:10vh auto 0;background:#fff;border-radius:18px;padding:24px;box-shadow:0 20px 60px rgba(15,23,42,.24)}
.rg-log-modal-card h3{margin:0 0 12px}
.rg-log-modal-card p{margin:0;color:#475569;line-height:1.6}
.rg-log-modal-actions{display:flex;gap:12px;margin-top:20px}
.rg-log-modal-actions .rg-log-button{width:auto;flex:1}
.rg-table-wrapper h2{margin-top:28px}
.rg-summary-aside .rg-summary-card{position:sticky;top:24px}
.rg-empty-note{color:#94a3b8;font-size:14px}
@media (max-width: 767px){
  .rg-log-modal-card{margin:6vh 16px 0;padding:20px}
  .rg-log-modal-actions{flex-direction:column}
}


.rg-supplements-inline{
    margin-top:16px;
    padding-top:16px;
    border-top:1px solid #e2e8f0;
}
.rg-supplements-inline h4{
    margin:0 0 10px;
    font-size:17px;
}

.rg-ingredient-actions-cell{white-space:nowrap}
.rg-ing-action-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;font-size:13px;line-height:1;cursor:pointer;margin-right:6px}
.rg-ing-action-btn:last-child{margin-right:0}
.rg-ing-replace-btn{color:#1d4ed8;border-color:#bfdbfe;background:#eff6ff}
.rg-ing-delete-btn{color:#c2410c;border-color:#fdba74;background:#fff7ed}
.rg-ingredient-add-host{margin-top:16px}
.rg-add-ingredient-bar{display:flex;gap:10px;align-items:center;padding:12px 14px;border-radius:12px;background:#fff7ed;border:1px solid #fdba74;margin-top:10px;flex-wrap:wrap}
.rg-add-ingredient-title{font-weight:700;color:#9a3412}
.rg-add-ingredient-select{flex:1 1 240px;min-width:180px;padding:10px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff}
.rg-add-ingredient-button,.rg-diff-accept-btn,.rg-replace-confirm{border:none;border-radius:10px;background:#0ea5b6;color:#fff;font-weight:700;padding:10px 14px;cursor:pointer}
.rg-replace-modal[hidden]{display:none}
.rg-replace-modal{position:fixed;inset:0;z-index:10000}
.rg-replace-modal__backdrop{position:absolute;inset:0;background:rgba(15,23,42,.55)}
.rg-replace-modal__dialog{position:relative;z-index:1;max-width:480px;margin:10vh auto 0;background:#fff;border-radius:16px;padding:20px;box-shadow:0 10px 30px rgba(0,0,0,.18)}
.rg-replace-modal__desc{margin:0 0 12px;color:#64748b}
#rg-replace-select{width:100%;padding:12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff}
.rg-replace-modal__actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px}
.rg-replace-cancel{border:1px solid #111827;background:#fff;color:#111827;border-radius:10px;padding:10px 14px;cursor:pointer}
.rg-diff-item{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.rg-diff-item__text{flex:1 1 240px}
@media (max-width:767px){
  .rg-ingredients-table td.rg-ingredient-actions-cell{padding-left:50%}
  .rg-ing-action-btn{padding:8px 9px;font-size:12px}
  .rg-add-ingredient-bar{align-items:stretch}
  .rg-add-ingredient-select,.rg-add-ingredient-button{width:100%}
  .rg-diff-item{align-items:flex-start}
}


/* --- Ingredient action buttons: cleaner colors + mobile-friendly layout --- */
.rg-ingredients-basic td[data-label="Alapanyag"],
.rg-ingredients-basic th:first-child{
    text-align:left;
}

.rg-ingredient-actions-cell{
    white-space:normal;
    text-align:left;
    vertical-align:middle;
}

.rg-ing-action-btn{
    min-height:36px;
    padding:8px 12px;
    border-radius:10px;
    font-weight:700;
    background:#ffffff;
    transition:background-color .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease;
}

.rg-ing-replace-btn{
    color:#2563eb;
    border-color:#93c5fd;
    background:#ffffff;
    box-shadow:0 0 0 1px rgba(147,197,253,.18) inset;
}

.rg-ing-replace-btn:hover,
.rg-ing-replace-btn:focus{
    color:#1d4ed8;
    border-color:#60a5fa;
    background:#eff6ff;
    outline:none;
}

.rg-ing-delete-btn{
    color:#dc2626;
    border-color:#fca5a5;
    background:#ffffff;
    box-shadow:0 0 0 1px rgba(252,165,165,.14) inset;
}

.rg-ing-delete-btn:hover,
.rg-ing-delete-btn:focus{
    color:#b91c1c;
    border-color:#f87171;
    background:#fef2f2;
    outline:none;
}

.rg-ingredients-basic td.rg-basic-g,
.rg-ingredients-basic th:last-child{
    text-align:left;
}

@media (max-width: 767px){
    .rg-table-wrapper{
        overflow-x:visible;
    }

    .rg-ingredients-basic{
        table-layout:fixed;
        width:100%;
    }

    .rg-ingredients-basic th,
    .rg-ingredients-basic td{
        padding:8px 6px;
        font-size:13px;
        vertical-align:top;
        text-align:left;
    }

    .rg-ingredients-basic th:nth-child(1),
    .rg-ingredients-basic td:nth-child(1){
        width:48%;
    }

    .rg-ingredients-basic th:nth-child(2),
    .rg-ingredients-basic td:nth-child(2){
        width:24%;
    }

    .rg-ingredients-basic th:nth-child(3),
    .rg-ingredients-basic td:nth-child(3){
        width:28%;
    }

    .rg-ingredients-basic td:first-child{
        white-space:normal;
        word-break:break-word;
        overflow-wrap:anywhere;
        line-height:1.35;
    }

    .rg-ingredient-actions-cell{
        padding-left:4px;
        padding-right:4px;
    }

    .rg-ing-action-btn{
        display:flex;
        width:100%;
        margin-right:0;
        margin-bottom:6px;
        padding:8px 10px;
        font-size:12px;
        line-height:1.2;
    }

    .rg-ing-action-btn:last-child{
        margin-bottom:0;
    }

    .rg-ingredients-basic td.rg-basic-g{
        white-space:normal;
        line-height:1.35;
    }
}


/* --- Ingredient action buttons final visual tuning --- */
.rg-ingredients-basic .rg-ing-action-btn{
    border-width:1px;
    border-style:solid;
    box-shadow:none;
}
.rg-ingredients-basic .rg-ing-replace-btn{
    color:#2563eb !important;
    border-color:#60a5fa !important;
    background:#eff6ff !important;
}
.rg-ingredients-basic .rg-ing-replace-btn:hover,
.rg-ingredients-basic .rg-ing-replace-btn:focus{
    color:#ffffff !important;
    border-color:#1d4ed8 !important;
    background:#1d4ed8 !important;
    outline:none;
}
.rg-ingredients-basic .rg-ing-delete-btn{
    color:#dc2626 !important;
    border-color:#f87171 !important;
    background:#fff5f5 !important;
}
.rg-ingredients-basic .rg-ing-delete-btn:hover,
.rg-ingredients-basic .rg-ing-delete-btn:focus{
    color:#ffffff !important;
    border-color:#dc2626 !important;
    background:#dc2626 !important;
    outline:none;
}

/* --- Ingredient actions mobile layout final fix --- */
@media (max-width: 767px){
    .rg-table-wrapper{
        overflow-x:hidden !important;
    }

    .rg-ingredients-basic{
        width:100%;
        table-layout:fixed;
    }

    .rg-ingredients-basic thead,
    .rg-ingredients-basic tbody,
    .rg-ingredients-basic tr{
        display:table-row-group;
    }

    .rg-ingredients-basic tr{
        display:table-row;
    }

    .rg-ingredients-basic th,
    .rg-ingredients-basic td{
        display:table-cell;
        box-sizing:border-box;
        vertical-align:top;
        text-align:left !important;
        padding:8px 6px !important;
        white-space:normal;
        word-break:break-word;
        overflow-wrap:anywhere;
    }

    .rg-ingredients-basic th:nth-child(1),
    .rg-ingredients-basic td:nth-child(1){
        width:46% !important;
    }

    .rg-ingredients-basic th:nth-child(2),
    .rg-ingredients-basic td:nth-child(2){
        width:24% !important;
    }

    .rg-ingredients-basic th:nth-child(3),
    .rg-ingredients-basic td:nth-child(3){
        width:30% !important;
    }

    .rg-ingredients-basic td:first-child{
        line-height:1.35;
    }

    .rg-ingredients-basic .rg-ingredient-actions-cell{
        white-space:normal !important;
        text-align:center !important;
        padding-left:4px !important;
        padding-right:4px !important;
    }

    .rg-ingredients-basic .rg-ing-action-btn{
        display:block;
        width:100%;
        max-width:100%;
        margin:0 0 6px 0 !important;
        padding:7px 8px !important;
        font-size:12px !important;
        line-height:1.2;
    }

    .rg-ingredients-basic .rg-ing-action-btn:last-child{
        margin-bottom:0 !important;
    }

    .rg-ingredients-basic td.rg-basic-g{
        line-height:1.35;
        text-align:left !important;
    }
}


/* --- Ingredient actions modal/button polish --- */
.rg-replace-search{
    width:100%;
    margin:0 0 12px;
    padding:12px;
    border:1px solid #cbd5e1;
    border-radius:10px;
    background:#fff;
    color:#0f172a;
}
.rg-replace-search:focus,
#rg-replace-select:focus{
    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,0.18);
}
.rg-ing-replace-btn{
    color:#2563eb !important;
    border-color:#2563eb !important;
    background:#eff6ff !important;
}
.rg-ing-replace-btn:hover{
    color:#fff !important;
    border-color:#1d4ed8 !important;
    background:#1d4ed8 !important;
}
.rg-ing-delete-btn{
    color:#dc2626 !important;
    border-color:#dc2626 !important;
    background:#fff5f5 !important;
}
.rg-ing-delete-btn:hover{
    color:#fff !important;
    border-color:#dc2626 !important;
    background:#dc2626 !important;
}
.rg-replace-cancel{border:1px solid #111827;background:#fff;color:#111827;border-radius:10px;padding:10px 14px;cursor:pointer}
.rg-replace-cancel:hover{
    border-color:#0f172a !important;
    background:#fff !important;
    color:#0f172a !important;
}
.rg-replace-confirm{
    background:#16a34a !important;
    color:#fff !important;
}
.rg-replace-confirm:hover{
    background:#15803d !important;
}
.rg-delete-confirm{
    border:none;
    border-radius:10px;
    background:#dc2626;
    color:#fff;
    font-weight:700;
    padding:10px 14px;
    cursor:pointer;
}
.rg-delete-confirm:hover{
    background:#b91c1c;
}
.rg-servings-stepper .rg-step-btn{
    border-color:#1d4ed8 !important;
    background:#1d4ed8 !important;
    color:#fff !important;
}
.rg-servings-stepper .rg-step-btn:hover{
    background:#1e40af !important;
    border-color:#1e40af !important;
}
@media (max-width:767px){
    .rg-replace-modal__dialog{
        width:calc(100% - 24px);
        margin:8vh auto 0;
        padding:16px;
    }
}


/* --- Replace modal live search results --- */
.rg-replace-search{
    width:100%;
    padding:12px;
    border:1px solid #cbd5e1;
    border-radius:10px;
    background:#fff;
    margin-bottom:10px;
}
.rg-replace-search-results{
    margin:0 0 10px;
    border:1px solid #dbeafe;
    background:#f8fbff;
    border-radius:12px;
    max-height:220px;
    overflow:auto;
    padding:6px;
}
.rg-replace-result-item{
    display:block;
    width:100%;
    text-align:left;
    border:1px solid transparent;
    background:#fff;
    color:#0f172a;
    border-radius:10px;
    padding:10px 12px;
    margin:0 0 6px;
    cursor:pointer;
}
.rg-replace-result-item:last-child{margin-bottom:0}
.rg-replace-result-item:hover,
.rg-replace-result-item:focus{
    background:#eff6ff;
    border-color:#93c5fd;
    outline:none;
}
.rg-replace-result-empty{
    padding:10px 12px;
    color:#64748b;
    font-size:14px;
}
.rg-replace-confirm{
    border:1px solid #111827;
    border-radius:10px;
    background:#16a34a;
    color:#fff;
    font-weight:700;
    padding:10px 14px;
    cursor:pointer;
}
.rg-replace-confirm:hover,
.rg-replace-confirm:focus{
    background:#15803d;
    border-color:#111827;
    color:#fff;
    outline:none;
}

/* mobile move summary card before preparation */
@media (max-width: 767px){
  .rg-detail-layout > .rg-summary-aside{
    margin:18px 0;
  }
}

.rg-replace-cancel:hover,.rg-replace-cancel:focus{background:#fff;color:#111827;border-color:#111827;outline:none}


/* --- 2026 color system polish --- */
:root{
  --rg-accent:#0EA5E9;
  --rg-accent-dark:#0284c7;
  --rg-accent-soft:rgba(14,165,233,.12);
  --rg-neutral:#111827;
  --rg-green:#16a34a;
  --rg-green-dark:#15803d;
}

.rg-meal-selector input[type="radio"]:checked + label{
  background:var(--rg-accent) !important;
  border-color:var(--rg-accent) !important;
  color:#fff !important;
}

.rg-diff-accept-btn{
  background:var(--rg-accent-soft) !important;
  color:var(--rg-accent) !important;
  border:1px solid var(--rg-accent) !important;
}
.rg-diff-accept-btn:hover,
.rg-diff-accept-btn:focus{
  background:var(--rg-accent-soft) !important;
  color:var(--rg-accent) !important;
  border-color:var(--rg-accent) !important;
  outline:none;
}

.rg-log-button{
  background:var(--rg-accent) !important;
  border:1px solid var(--rg-accent) !important;
  color:#fff !important;
  width:auto !important;
  min-width:180px;
  margin:14px auto 0 !important;
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.rg-summary-card{
  text-align:left;
}
.rg-summary-card .rg-log-button::before{
  content:"📝";
  line-height:1;
}
.rg-summary-card{
  display:flex;
  flex-direction:column;
}
.rg-summary-card .rg-log-button{
  align-self:center;
}
.rg-log-button:hover,
.rg-log-button:focus{
  background:var(--rg-accent) !important;
  border-color:var(--rg-accent) !important;
  color:#fff !important;
  opacity:1 !important;
}

.rg-servings-stepper .rg-step-btn{
  background:var(--rg-accent) !important;
  border-color:var(--rg-accent) !important;
}
.rg-servings-stepper .rg-step-btn:hover,
.rg-servings-stepper .rg-step-btn:focus{
  background:var(--rg-accent-dark) !important;
  border-color:var(--rg-accent-dark) !important;
  color:#fff !important;
}
#rg-servings-input{
  border-color:var(--rg-accent) !important;
}
#rg-servings-input:focus{
  box-shadow:0 0 0 3px rgba(14,165,233,.22) !important;
  border-color:var(--rg-accent) !important;
}

.rg-ing-replace-btn{
  color:var(--rg-accent) !important;
  border-color:var(--rg-accent) !important;
  background:var(--rg-accent-soft) !important;
}
.rg-ing-replace-btn:hover,
.rg-ing-replace-btn:focus{
  color:#fff !important;
  border-color:var(--rg-accent) !important;
  background:var(--rg-accent) !important;
  outline:none;
}

.rg-replace-result-item{
  background:rgba(14,165,233,.45) !important;
  border-color:rgba(14,165,233,.45) !important;
  color:#fff !important;
}
.rg-replace-result-item:hover,
.rg-replace-result-item:focus{
  background:var(--rg-accent) !important;
  border-color:var(--rg-accent) !important;
  color:#fff !important;
}

.rg-replace-cancel{
  color:var(--rg-neutral) !important;
  border-color:var(--rg-neutral) !important;
  background:#fff !important;
}
.rg-replace-cancel:hover,
.rg-replace-cancel:focus{
  color:var(--rg-neutral) !important;
  border-color:var(--rg-neutral) !important;
  background:#fff !important;
  outline:none;
}

.rg-replace-confirm{
  background:var(--rg-green) !important;
  color:#fff !important;
  border:1px solid #374151 !important;
}
.rg-replace-confirm:hover,
.rg-replace-confirm:focus{
  background:var(--rg-green-dark) !important;
  color:#fff !important;
  border-color:#374151 !important;
  outline:none;
}

.rg-delete-confirm{
  background:var(--rg-accent-soft) !important;
  color:#fff !important;
  border:1px solid var(--rg-accent) !important;
}
.rg-delete-confirm:hover,
.rg-delete-confirm:focus{
  background:var(--rg-accent) !important;
  color:#fff !important;
  border-color:var(--rg-accent) !important;
  outline:none;
}

@media (max-width:767px){
  .rg-summary-card .rg-log-button{
    width:100% !important;
    max-width:320px;
  }
}


/* --- final polish: delete confirm + replace button color system --- */
.rg-delete-confirm{
    background:#0EA5E9 !important;
    border:1px solid #0EA5E9 !important;
    color:#fff !important;
}
.rg-delete-confirm:hover,
.rg-delete-confirm:focus{
    background:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    color:#fff !important;
    outline:none !important;
}
.rg-ing-replace-btn{
    color:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    background:rgba(14,165,233,0.12) !important;
}
.rg-ing-replace-btn:hover,
.rg-ing-replace-btn:focus{
    color:#fff !important;
    border-color:#0EA5E9 !important;
    background:#0EA5E9 !important;
    outline:none !important;
}


/* --- Final polish overrides --- */
.rg-delete-confirm{
    background:#0EA5E9 !important;
    border:1px solid #0EA5E9 !important;
    color:#fff !important;
}
.rg-delete-confirm:hover,
.rg-delete-confirm:focus{
    background:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    color:#fff !important;
    outline:none;
}
.rg-ing-replace-btn{
    color:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    background:rgba(14,165,233,.12) !important;
}
.rg-ing-replace-btn:hover,
.rg-ing-replace-btn:focus{
    background:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    color:#fff !important;
    outline:none;
}
.rg-add-ingredient-button{
    background:#0EA5E9 !important;
    border:1px solid #0EA5E9 !important;
    color:#fff !important;
}
.rg-add-ingredient-button:hover,
.rg-add-ingredient-button:focus{
    background:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    color:#fff !important;
    outline:none;
}
.rg-summary-card{
    background:rgba(14,165,233,.08) !important;
    border:1px solid rgba(14,165,233,.18) !important;
}
.rg-summary-card h3{
    color:#0f172a !important;
}
.rg-log-button{
    background:#0EA5E9 !important;
    border:1px solid #0EA5E9 !important;
    color:#fff !important;
}
.rg-log-button:hover,
.rg-log-button:focus{
    background:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    color:#fff !important;
    opacity:1 !important;
}
.rg-log-button::before{
    content:"📝 ";
}
.rg-replace-confirm{
    border:1px solid #6b7280 !important;
    background:#16a34a !important;
    color:#fff !important;
}
.rg-replace-confirm:hover,
.rg-replace-confirm:focus{
    background:#16a34a !important;
    border-color:#6b7280 !important;
    color:#fff !important;
    outline:none;
}
.rg-replace-result-item{
    background:rgba(14,165,233,.18) !important;
    border-color:rgba(14,165,233,.28) !important;
    color:#fff !important;
}
.rg-replace-result-item:hover,
.rg-replace-result-item:focus,
.rg-replace-result-item.is-active{
    background:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    color:#fff !important;
    outline:none;
}
.rg-replace-cancel{
    background:#fff !important;
    border:1px solid #111827 !important;
    color:#111827 !important;
}
.rg-replace-cancel:hover,
.rg-replace-cancel:focus{
    background:#fff !important;
    border-color:#111827 !important;
    color:#111827 !important;
    outline:none;
}

.rg-servings-stepper .rg-step-btn,
.rg-servings-stepper .rg-step-btn:hover,
.rg-servings-stepper .rg-step-btn:focus{
    background:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    color:#fff !important;
    outline:none;
}
.rg-servings-stepper input,
.rg-servings-stepper .rg-stepper-input{
    border-color:#0EA5E9 !important;
}


/* --- Final final overrides: replace result list + delete confirm --- */
.rg-replace-search-results .rg-replace-result-item,
.rg-replace-search-results .rg-replace-result-item:hover,
.rg-replace-search-results .rg-replace-result-item:focus{
    background:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    color:#ffffff !important;
    outline:none !important;
}

.rg-delete-confirm,
.rg-delete-confirm:hover,
.rg-delete-confirm:focus{
    background:#0EA5E9 !important;
    border-color:#0EA5E9 !important;
    color:#ffffff !important;
    outline:none !important;
}


.rg-detail-container.rg-meal-gate-pending .rg-meal-selector,
.rg-detail-container.rg-meal-gate-pending .rg-detail-layout{
  display:none !important;
}
.rg-initial-meal-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:12px;
  margin-top:16px;
}
.rg-initial-meal-btn{
  appearance:none;
  border:1px solid #0EA5E9;
  background:#0EA5E9;
  color:#fff;
  border-radius:12px;
  padding:12px 14px;
  font-weight:600;
  cursor:pointer;
  box-shadow:none;
}
.rg-initial-meal-btn:hover,
.rg-initial-meal-btn:focus,
.rg-initial-meal-btn:active{
  background:#0EA5E9;
  color:#fff;
  border-color:#0EA5E9;
  box-shadow:none;
  outline:none;
}
@media (max-width: 640px){
  .rg-initial-meal-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}


/* FINAL force override for initial meal choice buttons */
.rg-replace-modal__dialog .rg-initial-meal-btn,
.rg-replace-modal__dialog button.rg-initial-meal-btn,
.rg-detail-container .rg-replace-modal__dialog .rg-initial-meal-btn,
.rg-detail-container .rg-replace-modal__dialog button.rg-initial-meal-btn{
  -webkit-appearance:none !important;
  appearance:none !important;
  background:#0EA5E9 !important;
  background-image:none !important;
  color:#ffffff !important;
  border:1px solid #0EA5E9 !important;
  box-shadow:none !important;
  text-shadow:none !important;
  outline:none !important;
  filter:none !important;
}

.rg-replace-modal__dialog .rg-initial-meal-btn:hover,
.rg-replace-modal__dialog .rg-initial-meal-btn:focus,
.rg-replace-modal__dialog .rg-initial-meal-btn:active,
.rg-replace-modal__dialog button.rg-initial-meal-btn:hover,
.rg-replace-modal__dialog button.rg-initial-meal-btn:focus,
.rg-replace-modal__dialog button.rg-initial-meal-btn:active,
.rg-detail-container .rg-replace-modal__dialog .rg-initial-meal-btn:hover,
.rg-detail-container .rg-replace-modal__dialog .rg-initial-meal-btn:focus,
.rg-detail-container .rg-replace-modal__dialog .rg-initial-meal-btn:active,
.rg-detail-container .rg-replace-modal__dialog button.rg-initial-meal-btn:hover,
.rg-detail-container .rg-replace-modal__dialog button.rg-initial-meal-btn:focus,
.rg-detail-container .rg-replace-modal__dialog button.rg-initial-meal-btn:active{
  -webkit-appearance:none !important;
  appearance:none !important;
  background:#0EA5E9 !important;
  background-image:none !important;
  color:#ffffff !important;
  border:1px solid #0EA5E9 !important;
  box-shadow:none !important;
  text-shadow:none !important;
  outline:none !important;
  filter:none !important;
  transform:none !important;
}
