/* ===== CSS Variables ===== */
:root {
  --bg:         #141414;
  --card-bg:    #1e1e1e;
  --border:     #2e2e2e;
  --text:       #e8e8e8;
  --muted:      #888;
  --accent:     #8b5cf6;
  --accent2:    #3a8fbf;
  --danger:     #c0392b;
  --success:    #27ae60;
  --font-body:  'Segoe UI', system-ui, sans-serif;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem 1rem; border-radius: var(--radius);
  border: 1px solid transparent; font-size: .875rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: opacity .15s, background .15s; text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover  { opacity: .88; text-decoration: none; }
.btn-ghost    { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover    { background: var(--border); text-decoration: none; }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover   { opacity: .88; }
.btn-sm       { padding: .3rem .7rem; font-size: .8rem; }
.btn-block    { width: 100%; justify-content: center; }
.btn-remove-row {
  background: none; border: none; color: var(--muted); font-size: 1.2rem;
  cursor: pointer; padding: 0 .3rem; line-height: 1; flex-shrink: 0;
}
.btn-remove-row:hover { color: var(--danger); }

/* ===== Forms ===== */
.form-control {
  display: block; width: 100%; padding: .45rem .75rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: .9rem; font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control-sm  { padding: .3rem .6rem; font-size: .8rem; }
.form-control-lg  { padding: .65rem .9rem; font-size: 1.1rem; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem;
}
.form-group { display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.form-label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.form-label-sm { font-size: .75rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { min-width: 180px; }
.form-section { padding: 1.25rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.required { color: var(--accent); }
.form-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.5rem; }

/* ===== Alerts ===== */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-error   { background: rgba(192,57,43,.18); border: 1px solid rgba(192,57,43,.4); color: #e87d73; }
.alert-success { background: rgba(39,174,96,.15); border: 1px solid rgba(39,174,96,.3); color: #6fcf97; }

/* ===== Header ===== */
.site-header { background: var(--card-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1400px; margin: 0 auto; padding: .6rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.site-title:hover { text-decoration: none; color: var(--accent); }
.header-nav { display: flex; align-items: center; gap: .5rem; }

/* ===== Login ===== */
.page-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 400px; padding: 1.5rem; }
.login-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.login-logo { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.login-logo-text { font-size: 1.2rem; font-weight: 700; }
.login-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.25rem; }
.login-box .form-group { margin-bottom: 1rem; }
.login-box .btn-block { margin-top: .5rem; }
.text-muted { color: var(--muted); font-size: .85rem; }

/* ===== Main layout ===== */
.main-layout {
  max-width: 1400px; margin: 0 auto; padding: 1.5rem;
  display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem;
}
@media (max-width: 768px) {
  .main-layout { grid-template-columns: 1fr; }
}

/* ===== Sidebar ===== */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-search { display: flex; gap: .5rem; }
.sidebar-search .form-control { flex: 1; }
.sidebar-section { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; }
.sidebar-heading { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem; }
.filter-list { display: flex; flex-direction: column; gap: .25rem; max-height: 200px; overflow-y: auto; }
.filter-item { display: flex; align-items: center; gap: .5rem; font-size: .85rem; cursor: pointer; padding: .15rem 0; }
.filter-item input { accent-color: var(--accent); }

/* ===== Recipe list ===== */
.recipe-list-area { min-width: 0; }
.list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.list-count { font-size: .85rem; color: var(--muted); }
.empty-state { text-align: center; padding: 3rem; color: var(--muted); }
.empty-state p { margin-bottom: 1rem; }
.recipe-grid { display: flex; flex-direction: column; gap: .75rem; }

/* ===== Recipe card ===== */
.recipe-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: border-color .15s; }
.recipe-card:hover { border-color: var(--accent); }
.recipe-card-header { padding: 1rem 1rem .5rem; }
.recipe-card-title-row { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .3rem; flex-wrap: wrap; }
.recipe-title { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.recipe-title a { color: var(--text); }
.recipe-title a:hover { color: var(--accent); text-decoration: none; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .78rem; color: var(--muted); margin-bottom: .4rem; }
.meta-cat { color: var(--accent2); }
.recipe-rating { margin-bottom: .4rem; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.recipe-weight { font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.recipe-note { padding: .5rem 1rem; font-size: .88rem; color: #ccc; border-top: 1px solid var(--border); }
.recipe-card-footer { padding: .5rem 1rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.recipe-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.made-status { font-size: .8rem; color: var(--success); }

/* ===== Tags / Badges ===== */
.tag { display: inline-block; padding: .15rem .55rem; background: rgba(255,255,255,.07); border: 1px solid var(--border); border-radius: 20px; font-size: .75rem; color: var(--text); cursor: pointer; text-decoration: none; line-height: 1.4; }
.tag:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.tag-more { border-style: dashed; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 20px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--border); color: var(--muted); }
.badge-green  { background: rgba(39,174,96,.2);  color: #6fcf97; }
.badge-orange { background: rgba(230,126,34,.2); color: #f39c12; }
.badge-red    { background: rgba(192,57,43,.2);  color: #e87d73; }
.badge-blue   { background: rgba(58,143,191,.2); color: #74b9e0; }
.badge-purple { background: rgba(142,68,173,.2); color: #c39bd3; }
.badge-default { background: var(--border); color: var(--muted); }

/* ===== Stars ===== */
.stars { font-size: .95rem; }
.star-full  { color: #f1c40f; }
.star-half  { color: #f1c40f; opacity: .5; }
.star-empty { color: var(--muted); }
.rating-text { font-size: .75rem; color: var(--muted); margin-left: .3rem; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }
.pagination .btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination-ellipsis { color: var(--muted); padding: 0 .3rem; }

/* ===== Rich content ===== */
.rich-content p  { margin-bottom: .5rem; }
.rich-content ul,
.rich-content ol { padding-left: 1.5rem; margin-bottom: .5rem; }
.rich-content li { margin-bottom: .2rem; }

/* ===== Side panel (history) ===== */
.side-panel { position: fixed; right: 0; top: 0; bottom: 0; width: 480px; max-width: 100vw; background: var(--card-bg); border-left: 1px solid var(--border); overflow-y: auto; z-index: 300; box-shadow: -4px 0 24px rgba(0,0,0,.5); }
.side-panel[hidden] { display: none; }
.side-panel-inner { padding: 1.25rem; }
.side-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.side-panel-title { font-size: 1.1rem; font-weight: 700; }
.side-panel-close { background: none; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.side-panel-close:hover { color: var(--text); }
.panel-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; }
.panel-backdrop[hidden] { display: none; }

/* ===== History ===== */
.history-entry { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; }
.history-entry-header { padding: .6rem .9rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; cursor: pointer; background: var(--bg); }
.history-entry-header:hover { background: rgba(255,255,255,.03); }
.history-type { font-size: .75rem; font-weight: 700; text-transform: uppercase; padding: .1rem .45rem; border-radius: 4px; }
.history-type-created  { background: rgba(39,174,96,.2);  color: #6fcf97; }
.history-type-edited   { background: rgba(58,143,191,.2); color: #74b9e0; }
.history-type-deleted  { background: rgba(192,57,43,.2);  color: #e87d73; }
.history-type-restored { background: rgba(230,126,34,.2); color: #f39c12; }
.history-date { font-size: .8rem; color: var(--muted); }
.history-editor { font-size: .8rem; color: var(--muted); }
.history-body { padding: .75rem .9rem; border-top: 1px solid var(--border); }

/* ===== Snapshot card ===== */
.snapshot-card { font-size: .88rem; }
.snapshot-title { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.snapshot-meta { font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.snapshot-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; }
.snapshot-rating { margin-bottom: .5rem; }
.snapshot-note { border-left: 3px solid var(--accent); padding-left: .75rem; margin-bottom: .75rem; color: #ccc; }
.snapshot-ingredients { list-style: none; padding: 0; margin-bottom: .75rem; }
.snapshot-ingredients li { padding: .15rem 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.ingredient-section { font-weight: 700; color: var(--accent2); padding-top: .5rem !important; }
.snapshot-steps { padding-left: 1.5rem; margin-bottom: .5rem; }
.snapshot-steps li { margin-bottom: .4rem; }

/* ===== Prefs panel ===== */
.prefs-panel { position: fixed; right: 1rem; top: 56px; width: 280px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); z-index: 200; box-shadow: var(--shadow); }
.prefs-panel[hidden] { display: none; }
.prefs-inner { padding: 1rem; }
.prefs-inner h3 { font-size: .95rem; font-weight: 700; margin-bottom: .75rem; }
.prefs-section { margin-bottom: .75rem; }
.pref-color { height: 36px; padding: 2px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; width: 48px; }
.prefs-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.prefs-status { font-size: .8rem; color: var(--success); margin-top: .5rem; min-height: 1.2em; }

/* ===== Edit page ===== */
.edit-main { max-width: 860px; margin: 0 auto; padding: 1.5rem; }
.edit-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.edit-title { font-size: 1.4rem; font-weight: 700; }

.richtext-toolbar { display: flex; gap: .25rem; flex-wrap: wrap; padding: .35rem .5rem; background: var(--bg); border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; }
.richtext-toolbar button { background: none; border: 1px solid transparent; border-radius: 4px; color: var(--text); padding: .2rem .55rem; font-size: .8rem; cursor: pointer; font-family: inherit; }
.richtext-toolbar button:hover { background: var(--border); }
.richtext-editor { min-height: 90px; padding: .65rem .85rem; background: var(--bg); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); color: var(--text); font-family: inherit; font-size: .9rem; line-height: 1.6; outline: none; }
.richtext-editor:focus { border-color: var(--accent); }
.richtext-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }

.ingredients-list { display: flex; flex-direction: column; gap: .4rem; }
.ingredient-row { display: flex; gap: .4rem; align-items: center; }
.ingredient-row .ing-amount { width: 80px; flex: none; }
.ingredient-row .ing-unit   { width: 80px; flex: none; }
.ingredient-row .ing-name   { flex: 1; }
.ingredient-row--section .ing-name { font-weight: 600; color: var(--accent2); }
.drag-handle { color: var(--muted); cursor: grab; font-size: 1rem; padding: 0 .2rem; flex-shrink: 0; }

.steps-list { display: flex; flex-direction: column; gap: .6rem; }
.step-row { display: flex; gap: .6rem; align-items: flex-start; }
.step-num { width: 24px; flex: none; font-size: .85rem; color: var(--muted); font-weight: 700; padding-top: .6rem; }
.step-row .richtext-editor { flex: 1; min-height: 60px; }

.rating-input-row { display: flex; align-items: center; gap: .75rem; }
.rating-slider { accent-color: var(--accent); flex: 1; cursor: pointer; }
.rating-display { font-size: .9rem; min-width: 40px; }

.tag-checkboxes { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-checkbox { display: flex; align-items: center; gap: .35rem; padding: .2rem .6rem; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; font-size: .8rem; cursor: pointer; }
.tag-checkbox:hover { border-color: var(--accent); }
.tag-checkbox input { accent-color: var(--accent); margin: 0; }

/* ===== Admin page ===== */
.admin-main { max-width: 900px; margin: 0 auto; padding: 1.5rem; }
.admin-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }
.admin-section { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.admin-section-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--border); color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.admin-table td { padding: .5rem .75rem; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.admin-list--tags { flex-direction: row; flex-wrap: wrap; }
.admin-list li { display: flex; align-items: center; gap: .5rem; }
.inline-add-form { display: flex; gap: .5rem; margin-top: .5rem; }
.inline-add-form .form-control { flex: 1; }
.admin-details { margin-top: .75rem; }
.admin-details summary { cursor: pointer; font-size: .85rem; color: var(--accent); user-select: none; margin-bottom: .5rem; }
.admin-sub-form { padding: .75rem; background: var(--bg); border-radius: var(--radius); margin-top: .5rem; }

/* ===== Modals ===== */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 500; }
.modal[hidden] { display: none; }
.modal-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; width: 360px; max-width: 95vw; box-shadow: var(--shadow); }
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: .5rem; margin-top: 1rem; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 400; }
.modal-backdrop[hidden] { display: none; }

/* ===== Make history ===== */
#make-history-section { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
#make-history-list { margin-bottom: .75rem; }
.makes-list { list-style: none; font-size: .85rem; }
.makes-list li { padding: .2rem 0; border-bottom: 1px solid rgba(255,255,255,.04); display: flex; gap: .75rem; color: var(--muted); }
.makes-list li:last-child { border-bottom: none; }

/* ===== Misc ===== */
.muted { color: var(--muted); }
.page-error { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-box { text-align: center; padding: 2rem; }
.error-box h1 { font-size: 1.5rem; margin-bottom: .75rem; }
.error-box .btn { margin-top: 1rem; }

/* ===== Last-made button ===== */
.btn-last-made {
  background: none; border: none; color: var(--accent2); font-size: .78rem;
  cursor: pointer; padding: 0; text-decoration: underline; font-family: inherit;
}
.btn-last-made:hover { color: var(--text); }

/* ===== Makes popup ===== */
.makes-popup {
  position: absolute; z-index: 400; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.5); min-width: 240px; max-width: 320px;
}
.makes-popup[hidden] { display: none; }
.makes-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .9rem; border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.makes-popup-header button {
  background: none; border: none; color: var(--muted); font-size: 1.1rem;
  cursor: pointer; line-height: 1; padding: 0;
}
.makes-popup-header button:hover { color: var(--text); }
#makes-popup-body { padding: .5rem .9rem .75rem; max-height: 260px; overflow-y: auto; }

/* ===== Unit converter ===== */
.conv-result { margin-top: .75rem; padding: .75rem; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); font-size: .875rem; }
.conv-result[hidden] { display: none; }
.conv-input-label { margin-bottom: .5rem; color: var(--muted); }
.conv-error { color: var(--danger); }
.conv-note { color: var(--muted); font-size: .82rem; margin-top: .5rem; }
.conv-table { border-collapse: collapse; margin-bottom: .5rem; }
.conv-table th { text-align: left; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: .15rem .6rem .15rem 0; }
.conv-table td { padding: .1rem .6rem .1rem 0; }
.conv-table td:first-child { font-weight: 600; min-width: 80px; }

/* ===== Density classes ===== */
.density-compact .recipe-grid  { gap: .4rem; }
.density-compact .recipe-card-header { padding: .65rem .75rem .3rem; }
.density-compact .recipe-title  { font-size: .95rem; }
.density-compact .recipe-meta   { font-size: .73rem; }
.density-compact .recipe-note   { padding: .4rem .75rem; font-size: .82rem; }
.density-compact .recipe-card-footer { padding: .35rem .75rem; }
.density-compact .recipe-tags   { gap: .25rem; }

.density-spacious .recipe-grid  { gap: 1.25rem; }
.density-spacious .recipe-card-header { padding: 1.4rem 1.4rem .7rem; }
.density-spacious .recipe-title  { font-size: 1.15rem; }
.density-spacious .recipe-meta   { font-size: .83rem; gap: .6rem 1.25rem; }
.density-spacious .recipe-note   { padding: .75rem 1.4rem; font-size: .92rem; }
.density-spacious .recipe-card-footer { padding: .7rem 1.4rem; }

/* ===== Card clickable ===== */
.recipe-card-clickable { cursor: pointer; }
.recipe-card-clickable .recipe-card-footer { cursor: default; }

/* ===== Recipe expand ===== */
.recipe-expand { border-top: 1px solid var(--border); padding: .75rem 1rem 1rem; }
.expand-section { margin-bottom: 1rem; }
.expand-section:last-child { margin-bottom: 0; }
.expand-heading { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .5rem; }
.expand-ings { list-style: none; padding: 0; font-size: .9rem; }
.expand-ings li { padding: .25rem .4rem; display: flex; gap: .5rem; border-radius: 4px; }
.expand-ings li:nth-child(even) { background: rgba(255,255,255,.05); }
.expand-ing-section { font-weight: 700; color: var(--accent2); border-bottom: none !important; margin-top: .5rem; }
.expand-amt { color: var(--accent); font-weight: 600; white-space: nowrap; }
.expand-steps { padding-left: 1.25rem; font-size: .9rem; }
.expand-steps li { margin-bottom: .6rem; line-height: 1.55; }
.expand-rating-note { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--accent); padding-left: .75rem; }

/* ===== Mobile header ===== */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: .35rem; padding: .5rem .75rem; }
  .site-title { flex: 1 0 auto; font-size: 1rem; }
  .header-nav { width: 100%; flex-wrap: wrap; gap: .3rem; }
  .header-nav .btn { padding: .3rem .6rem; font-size: .78rem; }
}

/* ===== Mobile main layout ===== */
.filter-toggle-btn { display: none; }

@media (max-width: 768px) {
  .main-layout { display: flex; flex-direction: column; padding: .75rem; gap: .75rem; }
  .recipe-list-area { order: 1; }
  .sidebar { order: 2; display: none; flex-direction: column; gap: .75rem; }
  .sidebar.sidebar-open { display: flex; }
  .filter-toggle-btn { display: inline-flex; }
  .filter-list { max-height: none; }
}

/* ===== Admin table mobile ===== */
@media (max-width: 700px) {
  .admin-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
