/* ======================================================
   1. CSS VARIABLES
   ====================================================== */
:root {
  --color-bg: #ffffff;
  --color-bg-soft: #f8f8f8;
  --color-border: #aaa;
  --color-text: #222;
  --color-muted: #666;

  --color-primary: #5b7cfa;
  --color-primary-hover: #4a6be0;
  --color-danger: #d9534f;
  --color-success: #5cb85c;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  --max-width: 1200px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.15);
  font-family: "Nunito Sans", sans-serif;
}

/* ======================================================
   2. BASE RESET
   ====================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito Sans", sans-serif;
  background: var(--color-bg-soft);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
}
body,p,li,button,input,select,textarea{
  font-family: "Nunito Sans", sans-serif;
}
.pm0 {
  padding: 0;
  margin: 0;
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ======================================================
   3. TYPOGRAPHY
   ====================================================== */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-sm);
  line-height: 1.25;
}

p {
  margin: 0 0 var(--space-md);
}

.text-muted {
  color: var(--color-muted);
}

.text-center {
  text-align: center;
}

/* ======================================================
   4. LAYOUT UTILITIES
   ====================================================== */
.header {
  width: 100%;
  padding: var(--space-md);
  background: var(--color-bg);
  display: flex;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.limg {
  height: 40px;
  border-radius: var(--radius-sm);
}
.limg img{
  height: 40px;
}

.dashlog {
  align-self: center;
}

.container {
  max-width: var(--max-width);
  margin: 32px auto;
  padding: 0 var(--space-md);
}

/* Bottom tab bar (native app style) */
.bottom-tab {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

.bottom-tab a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: var(--color-muted);
}
.boldtext{
  font-weight: 700;
}
a:hover .title{
  text-decoration: none !important ;
}
.bottom-tab a.active {
  color: var(--color-primary);
}
.card:hover .card--media .title{
  text-decoration: none !important;
}
/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Grid utilities */
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(25vw, 1fr));}

/* ======================================================
   5. SPACING UTILITIES
   ====================================================== */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ======================================================
   6. COMPONENTS
   ====================================================== */
/* Cards */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  position: relative;
}
.cardcoverlink{
  position:absolute;
  z-index: 1;
  top:0;
  left:0;
  width: 100%;
  height: 100%;
}
.card--interactive {
  cursor: pointer;
}

.card--interactive:hover,
.card--interactive:focus {
  background: var(--color-bg-soft);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  outline: none;
}
.card--media{
      position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: block;
}
.card--media img { border-radius: var(--radius-sm); margin-bottom: var(--space-sm); width: 100%;
    height: 100%;
    object-fit: cover;}
.card.card--interactive .text-muted{
display: inline-block;
}
/* Swipeable placeholder */
.card--swipe { 
  position: relative; 
  overflow: hidden; 
  touch-action: pan-y;
}

/* List reset */
.nomark, ul.grid { list-style: none; padding-left: 0; margin-left: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  background: none;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover{
  text-decoration: none;
}
.btn:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); text-decoration: none;}
.btn-secondary { border-color: var(--color-border); background: var(--color-bg-soft); color: var(--color-text); }
.btn-secondary:hover{filter:brightness(0.9)}
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: var(--color-danger); color: #fff; filter:brightness(0.9);}
.btn-small { font-size: 14px; padding: 8px 14px; }
.padbox { padding: var(--space-md); text-decoration: none !important; }

/* Floating action button */
.fab {
  position: fixed;
  bottom: 70px;
  right: 20px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1000;
}

.fab:hover { background: var(--color-primary-hover); transform: scale(1.05); }

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-content {
  background: var(--color-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  max-width: 500px;
  width: 100%;
  overflow-y: auto;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s ease;
}
.unit-conversion-panel {
    position: fixed;
    top: 0;
    right: -350px; /* hidden initially */
    width: 300px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
}

.unit-conversion-panel.open {
    right: 0;
}

.unit-conversion-panel .close-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 1.2rem;
}
.recipe-gallery {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin-bottom: 10px;
    min-height: 200px;
    background: #ccc;
    border-radius: 8px;
}

.recipe-gallery img {
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

#prevImage { left: 5px; }
#nextImage { right: 5px; }

.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.fullscreen-overlay img {
    max-width: 90%;
    max-height: 90%;
}
.ingredient-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    gap: 12px;
}
.ingredient-item div{
      padding:4px 8px;
}
.slist .ingredient-item div{
      padding:0;
}
.ingredient-item:nth-of-type(even) div{
      background:#ccc;
}
.ingredient-item .iname {
    font-weight: 500;
    text-transform: capitalize;
}
.ingredient-details{
      min-width: 40px;
      text-align:left;
      padding-right:4px;
}
.optional-badge {
    background: var(--color-muted);
    color: #fff;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.75rem;
    margin-left: 5px;
}

.instructions-list .instruction-step {
    margin-bottom: 10px;
}
.backto{
      margin-bottom: 8px;
    display: inline-block;
    cursor: pointer;
}
button{
    cursor: pointer;
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    background: var(--color-primary);
    color: #fff;
    transition: background 0.2s;
}

button:hover{
    background: var(--color-primary-hover);
     color: #fff;
}
.open-unit-panel{
    position: fixed;
    z-index: 10;
    bottom: 24px;
    right: 24px;
    font-size: 1.75rem;
    box-shadow: 0 0 4px #999;
    padding: 12px;
}
.open-unit-panel:hover i{
animation: spin 5s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg); /* Start at 0 degrees */
  }
  100% {
    transform: rotate(360deg); /* Rotate a full 360 degrees */
  }
}
.title-row{
  position: relative;
}
.favorite-btn{
    background: var(--color-muted);
    position: absolute;
    top: 5px;
    right: 0;
    padding: 8px;
}
.favorite-btn:hover{
  background:var(--color-muted);
  filter:brightness(1.2);
}
.favorite-btn.active{
  background: var(--color-danger) !important;
  filter:brightness(1) !important;
}
.servhold {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.servhold input[type=number] {
    width: 50px;
    text-align: center;
    padding: 4px;
}
/* ======================================================
   7. FORMS
   ====================================================== */
.form { width: 100%; }
.form-group { display: flex; flex-direction: column; margin-bottom: var(--space-md); }
.form-row { display: flex; gap: var(--space-md); flex-wrap: wrap; }

.input,
.textarea,
.select {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all 0.2s ease;
}

.input:focus,
.textarea:focus,
.select:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.textarea { min-height: 120px; resize: vertical; }
.form-actions { display: flex; gap: var(--space-sm); }

/* ======================================================
   8. STATE HELPERS
   ====================================================== */
.is-hidden { display: none; }
.is-active { border-color: var(--color-primary); }
.is-disabled { opacity: 0.6; pointer-events: none; }

.card--alert {
  padding: var(--space-md);
  font-weight: 500;
}

.card--success {
  border-color: #4caf50;
  background: #e8f5e9;
  color: #2e7d32;
}

.card--danger {
  border-color: var(--color-danger);
  background: #fbeaea;
  color: var(--color-danger);
}

.d-block { display: block; }
.col-span-2 { grid-column: span 2; }
.bg-black-90 { background: rgba(0,0,0,0.9); }

.thumbnail-sm {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nextprev{
    display: flex;
    justify-content: space-between;
    border-top: solid 1px var(--color-muted);
    padding: 16px 0;
    margin: 32px 0;
}
footer{
      margin-top: 100px;
}
.importedbubble{
      font-size: 12px;
    display: inline-block;
    background: #ddd;
    padding: 8px;
    border-radius: 100px;
    vertical-align: middle;
    color:var(--color-text-main);
  text-decoration: none !important;
}
.importedbubble a{
  color:var(--color-text-main);
  text-decoration: none !important;
}
.topsec{
  display: flex;
    gap: 32px;
    border-bottom: solid 1px var(--color-muted);
    padding: 0 0 16px 0;
    margin-bottom: 16px;
}
.icollect{
      width: 33%;
}
.desc{
     width: 66%; 
}
.home .desc{
     width: 100%; 
}
.toggle-switch {
position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

/* Hide default HTML checkbox */
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}
.toggle-item{
      margin: 8px 0;
}
label, .close-modal{
  cursor: pointer;
}
.recipe-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.recipe-card {
  position: relative;
  background: var(--card-bg, #fff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  display: flex;
    flex-direction: column;
}
.recipe-card:hover{
filter: brightness(0.97);
}
.recipe-card .card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #aaa;
 
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 1.5rem;
   color: #f3f3f3;
}
.card-body {
  padding: .75rem .9rem;
  position: relative;
}

.card-title {
  font-size: 1rem;
  margin: 0;
      padding-right: 12px;
}

.card-meta {
  font-size: .85rem;
  opacity: .7;
  margin-top: .25rem;
}
.card-actions {
  display: flex;
  gap: .5rem;
  padding: .75rem;
  border-top: 1px solid rgba(0,0,0,.06);
  position: relative;
  z-index: 2;
  justify-content: space-between;
      margin-top: auto;
}
.nonum{
  display: none;
}
.favorite-heart {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: rgba(255, 255, 255, .85);
    border-radius: 50%;
    font-size: .9rem;
    z-index: 2;
    height: 35px;
    width: 35px;
    text-align: center;
    line-height: 38px;
    display: none;
}
.favorite-heart i{
      color: #666;
}
.favorite-heart.active{
  display: block;
}
.favorite-heart.active i{
  color: #e63946;
}
.filters{
      margin: 16px 0;
}
.searchbox{
     padding: 4px; 
}
.searchcats{
  padding: 5px;
}
/* Card inner spacing */
.card-inner {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

/* Recipe main image */
.recipe-main-img {
    max-width: 200px;
    border-radius: 4px;
}

/* Sticky actions on mobile */
.sticky-actions {
    background: #fff;
    padding: 15px;
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid #ccc;
    z-index: 10;
}

/* Ingredients & instructions spacing */
.ingredient-item, .instruction-item {
    margin-bottom: 8px;
}
.recholder .ingredient-item{
    margin-bottom: 0;
}
/* Time fields */
.time-group input {
    width: 70px;
    margin-right: 5px;
}
.shared-section { display: none; }
.shared-section.active { display: block; }
.friend-list{
  list-style: none;
    padding-left: 0;
    margin-left: 0;
}
.friend-list li {
    cursor: pointer;
    padding: 5px;
    border: 1px solid #ccc;
    margin-bottom: 3px;
    border-radius: 4px;
}
.friend-list li:hover {
    background: #f0f0f0;
}
.radio-option { margin-bottom: 5px; }
.list-item { margin-bottom: 5px; }
.slist .shopping-row{
      display: flex;
    justify-content:left;
    align-items: center;
}
.slist .ingredient-details{
    display: flex;
    justify-content: center;
    align-items: center;
}
.fraction > sup, .fraction > sub {
    font-size: 0.66em; /* Makes numerator/denominator smaller */
}
.fraction > sup {
    vertical-align: 0.4em; /* Raises the numerator */
}
.fraction > sub {
    vertical-align: -0.2em; /* Lowers the denominator */
}
.shopping-checkbox{
  zoom:1.25;
}
.ingname{
  width:40%;
}
.ingname + input{
  width:20%;
}
#instructions-container textarea{
  width: 100%;
}
.planner .card{
  margin-bottom:16px;
}
.planner input[type="number"] {
    width: 50px;
    text-align:left;
}
.planner input, .planner select{
  cursor: pointer;
}

.inglist{
  list-style: none;
    padding-left: 0;
    margin-left: 0;
}
.inglist li{
  padding: 4px;
}
.inglist li:nth-of-type(even){
  background: #ccc;
}
.ingname{
  font-weight: 700;
}

.header img{
  border-radius: 0;
}
.slist .ingredient-item{
  text-align: left;
}
.group-link{
      display: flex;
}
.group-name{
      text-transform: capitalize;
    font-weight: 700;
}
.group-meta{
  display: flex;
    font-size: 12px;
    align-items: center;
    padding: 0 8px;

}
.group-list{
  list-style: none;
    padding-left: 0;
    margin-left: 0;
}
.groups .card, .groupsettings .card{
  margin-bottom: 16px;
}
.group-details-header h2{
  text-transform: capitalize;
}
#recipe_image_preview{
  max-width: 300px;
  margin-top:16px;
}
.imported-recipe-form{
  display: none;
}
.imported-recipe-form.active{
  display: block;
}
.imported-recipe-form input{
  margin-bottom:8px;
}
.imported-recipe-form h2{
  margin-top:24px;
}
.imported-recipe-form #description{
      width: 100%;
    min-height: 150px;
}
.imported-recipe-form label{
  font-weight: 700;
}
.imported-recipe-form .instruction{
      display: flex;
    vertical-align: middle;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.imported-recipe-form .instruction textarea{
  width: calc(100% - 100px);
    min-height: 50px;
}
.pageurl{
  display: none;
}
.deleterec{
  position: absolute;
    right: 8px;
    top: 8px;
    z-index: 9;
    color: var(--color-danger);
    
}
.deleterec i{
  opacity: 0;
}
.recipe-card:hover .deleterec i{
  opacity: 0.3;
}
.recipe-card:hover .deleterec:hover i{
  opacity: 1;
}
.sibtn{
  margin-top:8px;
}
.dashboard .card p {
  width: 100%;
}
.redicon{
  color:var(--color-danger)
}
.greenicon{
  color:var(--color-success)
}
.subcategory-options{
      display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50%, 1fr));
}
.subcategory-options label{
  padding: 4px;
}
.subcategory-options{
      height: 0;
    overflow: hidden;
    max-width:400px;
}
.subcategory-options.active{
    height: auto;
}
.subopenclose{
 cursor: pointer;
 margin:8px 0;
   position: relative;
   display: inline-block;
}
.subopenclose i{
  color:var(--color-primary);
  position: relative;
 
}
.subopenclose:after{
  color:var(--color-primary);
  position:absolute;
  content:'View';
  font-family: "Nunito Sans", sans-serif;
  font-size: 16px;
}
.subopenclose:hover:after{
  text-decoration: underline;
}
.subopenclose.active i{
      transform: rotate(180deg);
}
.subopenclose.active:after{
  content:'Hide';
}
.instruction-step{
      white-space: pre-wrap;
}
.instruction-step p{
  margin: 0;
  padding:0;
}
.pill{
font-size: smaller;
    background: var(--color-muted);
    padding: 4px 8px;
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: 0;
    color: #ffff;
}
.pill.sha{
    background: var(--color-primary);
    color:#fff;
}
.sharing .success{
  background: var(--color-success);
    padding: 4px;
    color: #fff;
    font-weight: 600;
}

.amount[data-base="0.000"] {
  display:none;
}
.ingredients-list {
  display: grid;
  grid-template-columns: max-content auto;
  row-gap: 6px; /* optional */
}
.slist .ingredients-list{
  display: flex;
      flex-direction: column;
}

.ingredient-item {
  display: contents;
}
.slist .ingredient-item{ 
  display: block;
}
.slist .ingredient-item:nth-of-type(even){
      background: #ccc;
}
.keepawake{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
     background:transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    float:right;
}
.keepawake.active{
  background:var(--color-success);
  border: 1px solid var(--color-success);
    color: #fff;
}
@media (min-width: 39.9375em){

  .planner .card .card, .planner .card{
  overflow-x:auto;
}
  .recipestbl td{
    border-bottom: solid 1px var(--color-muted);
    border-right: solid 1px var(--color-muted);
  }
  .recipestbl th{
    border-top: solid 2px var(--color-muted);
    border-right: solid 1px var(--color-muted);
  }
  .recipestbl td:nth-of-type(1), .recipestbl th:nth-of-type(1){
    border-left: solid 1px var(--color-muted);
  }
  .recipestbl tr:nth-of-type(1) td,.recipestbl tr:nth-of-type(1) th{
    border-top: solid 1px var(--color-muted);
  }
  .recipestbl tr:nth-of-type(even) td{
    background: #ddd;
  }
  .timertbl.tablesaw-stack tbody tr:nth-of-type(even) td{
    background: #ddd;
  }
  .recname{
    font-weight: 700;
  }
  .timertbl.tablesaw-stack tr{
    display: flex;
  }
  .timertbl.tablesaw-stack td, .timertbl.tablesaw-stack th{
    border-right: solid 1px var(--color-muted);
  }
  .timertbl.tablesaw-stack th{
    border-bottom:solid 1px var(--color-muted);
  }
  .timertbl.tablesaw-stack td:nth-of-type(1), .timertbl.tablesaw-stack th:nth-of-type(1){
    width:300px;
    border-left: solid 1px var(--color-muted);
  }
  .timertbl.tablesaw-stack td:nth-of-type(2), .timertbl.tablesaw-stack th:nth-of-type(2){
    width:120px;
  }
  .timertbl.tablesaw-stack td:nth-of-type(3), .timertbl.tablesaw-stack th:nth-of-type(3){
    width:120px;
  }
  .timertbl.tablesaw-stack td:nth-of-type(4), .timertbl.tablesaw-stack th:nth-of-type(4){
    width:120px;
  }
  .timertbl.tablesaw-stack td:nth-of-type(5), .timertbl.tablesaw-stack th:nth-of-type(5){
    width:120px;
  }
  .timertbl.tablesaw-stack tbody tr:last-of-type td{
    border-bottom:solid 1px var(--color-muted);
  }
  h3.cooktype{
        background: #333;
    color: #fff;
    padding: 8px;
    text-align:left;
    font-size: 1.5rem;
    margin: 0;
  }
}
/* ======================================================
   9. RESPONSIVE / MOBILE ADJUSTMENTS
   ====================================================== */
@media (max-width: 39.9375em) {
    .keepawake{
    font-size: 14px;
    padding: 10px 16px;
  }
  .subcategory-options{
      display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50%, 1fr));
}
  .createnew{
    white-space: nowrap;
  }
  .instructions-list .instruction-step{
    border-bottom: solid 1px #aaa;
  }
  #recipe_url{
        margin-bottom: 8px;
  }
  .imported-recipe-form .ingredient{
    padding: 8px;
    border: solid 1px #aaa;
    margin: 4px 0;
  }
  #addIngredient{
    margin-top:16px;
  }
  .ingname{
  width:100%;
}
  .container,
  .header-content { padding: 0 var(--space-md); }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  .btn { font-size: 14px; padding: 10px 16px; }
  .btn-small { font-size: 13px; padding: 8px 12px; }
  .card { padding: var(--space-sm); }
  .modal-content { padding: var(--space-md); margin: 0 10px; }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-auto { grid-template-columns: 1fr !important; }

  .grid-auto li.card {
    width: 100%;
    min-height: 70px;
    padding: var(--space-md);
  }

  .grid-auto { gap: var(--space-sm); }

  .input,
  .textarea,
  .select, .ingname + input { width: 100%; }
  .card-image {
    position: relative;
    aspect-ratio: 5 / 3;
    background: #aaa;
    overflow: hidden;
  }
      .favorite-btn {
        background: var(--color-muted);
        position: relative;
        top: -2px;
        left: 0;
        right: auto;
        float: right;
    }
    .recipe-gallery {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      max-width: 100%;
      margin-bottom: 10px;
      min-height: 100px;
      background: #ccc;
      border-radius: 8px;
  }
  .action-buttons{
    text-align: center;
  }
  .remixbtn{
        margin-top: 8px;
    display: inline-block;
  }
  .ingredient-item, .instruction-item{
    margin-bottom:16px;
        flex-direction: column;
  }
  #instructions-container textarea{
    min-height: 200px;
  }
  .mcolumn{
    flex-direction: column;
    gap: 8px;
  }
  .collections .card{
    width: 100%;
  }
  .recipestbl.tablesaw-stack td .tablesaw-cell-label, .recipestbl.tablesaw-stack th .tablesaw-cell-label{
    width: 50%;
  }
      .recipestbl.tablesaw-cell-content {
        display: inline-block;
        max-width: 50%;
    }
  .recipestbl .tablesaw td, .recipestbl .tablesaw th{
    padding: 4px;
  }
  .recipestbl .tablesaw td.recname{
    padding-top:8px;
  }
  .recname .tablesaw-cell-content{
    width: 100%;
  }
  .recname b{
    display: none !important;
  }
  .recname span{
    font-weight: 700;
    font-size: 1.25rem;
  }
  .plancheck input{
    zoom: 1.25;
  }
  .timertbl.tablesaw-stack tbody td:nth-of-type(1) b{
    display: none;
  }
  .timertbl.tablesaw-stack tbody td:nth-of-type(1){
    font-weight: 700;
    background:var(--color-primary);
    color:#fff;
    margin-top:0;
  }
   .timertbl.tablesaw-stack tbody td:nth-of-type(2), 
   .timertbl.tablesaw-stack tbody td:nth-of-type(3), 
   .timertbl.tablesaw-stack tbody td:nth-of-type(4),
   .timertbl.tablesaw-stack tbody td:nth-of-type(5){
    width: 50%;
    clear: none;
    display: flex;
    align-items: center;
   }
   .timertbl.tablesaw-stack tbody td:nth-of-type(2), 
   .timertbl.tablesaw-stack tbody td:nth-of-type(3){
     background: #ccc;
   }
  .timertbl.tablesaw-stack tbody tr{
    border: none !important;
  }
  h3.cooktype{
        background: #333;
    color: #fff;
    padding: 8px;
    text-align: center;
    font-size: 1.5rem;
    margin: 0;
  }
  .timertbl.tablesaw-stack tbody td:last-of-type{
    margin-bottom: 16px;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3,
  .grid-4,
  .grid-auto { grid-template-columns: repeat(2, 1fr); }
  .modal-content { max-width: 90%; }
}
@media (min-width: 640px) {
  .recipe-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}
@media print {
  .optional-badge{
    background:#fff;
    color: var(--color-text);
    border-left:solid 1px var(--color-text);
    border-radius: 0;
  }
  .pageurl{
  display: block;
}
  body{
    background:#fff;
  }
    .backto, .action-buttons, #addToListBtn, .unit-conversion-panel, .nextprev, .open-unit-panel, #prevImage, #nextImage, .dashlog,  .importedbubble, #favorite-btn, #removeCheckedBtn, .keepawake{
    display: none;
  }
  .limg img, .limg{
        height: 30px;
  }
  .header{
    position: static;
  }
  .ingredients-list{
    margin-bottom: -60px;
  }
  .servhold button{
    opacity: 0;
  }
  .container{
    margin: 8px auto;
  }
  .ingredient-item, .instruction-item{
    margin-bottom: 0;
  }
  .ingredient-item{
    padding: 4px;
        border-top: 1px solid #aaa;
  }
  .ingredient-item:nth-of-type(even){
    background: #fff;
  }
  .icollect {
    width: auto;
  }
  .recipe-gallery {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      max-width: 100%;
      margin-bottom: 10px;
      min-height: 50px;
      border-radius: 8px;
      height: 100px;
      background: #fff;
  }
  .recipe-gallery img{
    height: 100px;
  }
  .ing{
        width: 45%;
    padding-right: 10px;
    border-right: solid 3px #ddd;
    font-size:16px;
  }
  .splitin{
    display: flex;
    gap: 16px;
    font-size:16px;
  }
  .ingredient-details{
        white-space: nowrap;
  }
}