:root { --portal-text: #f4f4f2; --portal-muted: #aaa5b7; --portal-violet: #b99aff; }
.diet-workspace { width:100%; max-width:1000px; }
.meal-library-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.meal-filters { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.meal-filters button { min-height:44px; padding:8px 14px; border:1px solid #51455c; border-radius:22px; background:#17141f; color:var(--portal-muted); font:inherit; font-size:13px; cursor:pointer; }
.meal-filters button[aria-pressed=true] { background:var(--portal-violet); color:#131019; border-color:var(--portal-violet); }
.meal-browser > label { display:grid; gap:8px; font-size:13px; color:var(--portal-muted); }
.meal-browser input[type=search] { box-sizing:border-box; width:100%; min-height:48px; padding:12px; background:#191824; color:var(--portal-text); border:1px solid #51455c; border-radius:12px; font:inherit; }
.meal-result { margin:10px 0; border:1px solid #393342; border-radius:16px; overflow:hidden; background:#12121c; }
.meal-result-header { display:flex; align-items:center; gap:12px; padding:14px; }
.meal-detail-toggle { display:grid; gap:6px; flex:1; min-width:0; min-height:44px; padding:0; text-align:left; background:transparent; border:0; color:var(--portal-text); font:inherit; cursor:pointer; overflow-wrap:anywhere; }
.meal-detail-toggle strong { font-size:15px; line-height:1.4; }
.meal-detail-toggle span { color:var(--portal-muted); font-size:12px; }
.meal-result-header > .button { flex-shrink:0; min-width:62px; }
.diet-workspace .button.primary { background:var(--portal-violet); color:#131019; border-color:var(--portal-violet); }
.meal-result-details { border-top:1px solid #393342; padding:16px; }
.meal-macros { display:flex; gap:16px; flex-wrap:wrap; margin:16px 0; }
.meal-macros > div { display:grid; gap:4px; min-width:80px; }
.meal-macros span { font-size:11px; color:var(--portal-muted); }
.meal-ingredients { list-style:none; padding:0; margin:12px 0; }
.meal-ingredients li { display:flex; justify-content:space-between; align-items:start; gap:16px; border-top:1px solid #302d3d; padding:10px 0; font-size:13px; }
.meal-ingredients li span:last-child { flex-shrink:0; color:var(--portal-muted); }
.diet-workspace details > summary { min-height:44px; cursor:pointer; color:var(--portal-text); }
@media(max-width:480px) { .meal-result-header { gap:8px; padding:12px; } .meal-result-details { padding:12px; } }
.search-box { padding-right:3px; }
.search-open { flex-shrink:0; min-height:32px; padding:6px 10px; border:1px solid #51465f; border-radius:6px; background:#24202e; color:var(--portal-text); font:inherit; cursor:pointer; }
.search-open:hover { background:#352a46; }
.diet-workspace { display:grid; gap:20px; min-width:0; }
.diet-card { padding:24px; min-width:0; overflow-wrap:anywhere; }
.diet-card h1,.diet-card h2,.diet-card h3 { margin:0 0 12px; }
.diet-card p { color:var(--portal-muted); line-height:1.6; margin:12px 0; }
.diet-card fieldset { border:0; margin:0; padding:0; min-width:0; }
.diet-card .diet-section-heading { margin:0; }
.diet-section-toggle { display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; min-height:44px; padding:0; border:0; background:transparent; color:var(--portal-text); font:inherit; font-weight:inherit; text-align:left; cursor:pointer; }
.diet-section-action { flex-shrink:0; color:var(--portal-violet); font-size:12px; font-weight:600; }
.diet-section-content[hidden] { display:none; }
@media(max-width:480px) { .diet-section-toggle { align-items:flex-start; flex-direction:column; gap:8px; } }
.diet-card .diet-error { color:#ffaaaa; }
.diet-card select,.diet-card textarea { box-sizing:border-box; width:100%; max-width:100%; padding:12px; background:#191824; color:var(--portal-text); border:1px solid #302d3d; border-radius:8px; font:inherit; }
.diet-card textarea { min-height:90px; resize:vertical; }
.diet-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; }
.diet-row { display:grid; gap:12px; padding:16px 0; border-top:1px solid #302d3d; }
.diet-card .button { min-height:44px; white-space:normal; }
@media(max-width:720px) { .diet-card { padding:16px; } .portal-nav { overflow-x:auto; } .portal-nav button { flex-shrink:0; } }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--portal-violet); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .55; }
.aligned-panel { color: var(--portal-text); padding: 1.5rem; width: min(680px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; overflow-wrap: anywhere; background: #11121a; border: 1px solid #302d3d; border-radius: 16px; }
.aligned-panel h2, .aligned-panel h3 { margin: .6rem 0; color: var(--portal-text); }
.aligned-panel p { margin: .75rem 0; color: var(--portal-muted); line-height: 1.6; }
.aligned-heading, .aligned-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.aligned-actions { margin-block: .75rem; }
.aligned-notification { border-top: 1px solid #302d3d; padding-block: 1rem; }
.aligned-toggle { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; cursor: pointer; }
.aligned-toggle input { width: 20px; height: 20px; accent-color: var(--portal-violet); }
.aligned-form { display: grid; gap: 1rem; }
.aligned-form label { display: grid; gap: .5rem; }
.aligned-form input { box-sizing: border-box; width: 100%; padding: .75rem; background: #191824; color: var(--portal-text); border: 1px solid #302d3d; border-radius: 8px; font: inherit; }
.aligned-panel .button { min-height: 44px; white-space: normal; }
.search-result[aria-selected=true] { outline: 2px solid var(--portal-violet); outline-offset: -2px; background: #211a33; }
@media(max-width:720px) {
  .aligned-panel { padding: 1rem; }
  .topbar { flex-wrap: wrap; height: auto; gap: .75rem; padding-block: .75rem; }
  .search-box { display: flex !important; flex: 1 1 100%; min-width: 0; order: 2; }
  .search-box input { min-width: 0; width: 100%; }
  .search-results { width: 100%; min-width: 0; }
  .portal-nav button, .icon-button, .topbar-account { min-height: 44px; }
}

.action-modal.aligned-panel .aligned-toggle { display:flex; flex-direction:row; align-items:center; font-size:14px; margin:0; gap:12px; }
.action-modal.aligned-panel .aligned-toggle input { flex:0 0 20px; width:20px; height:20px; margin:0; padding:0; }
.mobile-org-switch { display:none; }
.routine-library { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.workout-workspace { width:100%; max-width:1120px; }
.workout-workspace .button { background:#24202d; border:1px solid #51455c; color:#f3eef8; }
.workout-workspace .button.primary { background:#c49c60; border-color:#c49c60; color:#121015; }
.routine-library button[aria-pressed=true] { border-color:var(--portal-violet); background:#312542; color:#fff; }
.routine-day { display:grid; gap:16px; min-width:0; }
.routine-exercise { display:grid; gap:12px; padding:18px; border:1px solid #393342; border-radius:12px; background:#12121c; }
.routine-prescription { display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(95px,1fr)); }
.routine-save { display:grid; gap:12px; border-top:1px solid #393342; padding-top:18px; }
.workout-workspace fieldset { min-width:0; border:0; padding:0; margin:0; }
.workout-workspace summary { cursor:pointer; padding:10px 0; }
.workout-workspace h3 { margin:0; }
.workout-workspace .routine-library .button { max-width:100%; overflow-wrap:anywhere; }
@media(max-width:600px) { .routine-exercise { padding:12px; } .routine-prescription { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:720px) { .mobile-org-switch { display:inline-flex; } }

@media(max-width:720px) { .portal-shell .topbar { display:flex; flex-wrap:wrap; height:auto; } .portal-shell .topbar .search-box { order:3; flex:1 1 100%; width:100%; max-width:none; } .portal-shell .topbar .topbar-actions { margin-left:auto; } }
