:root {
  --ink: #142033;
  --ink-strong: #0d1420;
  --muted: #657386;
  --muted-strong: #465466;
  --line: #d9e1ea;
  --line-soft: #edf1f5;
  --paper: #f5efe4;
  --surface: #ffffff;
  --surface-subtle: #fffaf2;
  --surface-warm: #fffdf8;
  --vintage-cream: #fff8ea;
  --vintage-sage: #eef7ea;
  --vintage-line: rgba(184, 137, 84, 0.22);
  --vintage-shadow: 0 18px 44px rgba(116, 83, 45, 0.1);
  --sidebar: #0d1726;
  --accent: #1f8a70;
  --accent-strong: #0f6f58;
  --module-accent: #1f8a70;
  --module-accent-soft: rgba(31, 138, 112, 0.1);
  --gold: #b88954;
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --success: #067647;
  --success-bg: #ecfdf3;
  --shadow-soft: 0 16px 40px rgba(13, 20, 32, 0.08);
  --shadow-panel: 0 24px 70px rgba(13, 20, 32, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 9% 6%, rgba(184, 137, 84, 0.12), transparent 20rem),
    radial-gradient(circle at 96% 14%, rgba(31, 138, 112, 0.1), transparent 22rem),
    linear-gradient(135deg, #f8f1e6 0%, #eef6ed 46%, #f8fafc 100%);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

body.mobile-menu-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.ui-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action,
.compact-icon-action,
.icon-only-button,
.record-title-icon,
.inventory-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-only-button {
  justify-content: center;
  width: 2.45rem;
  min-height: 2.45rem;
  padding: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 138, 112, 0.2);
  outline-offset: 2px;
}

.beoflow-app {
  min-height: 100vh;
}

.session-loading,
.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 28rem);
  align-items: center;
  gap: 4rem;
  width: min(1160px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 4rem 0;
}

.session-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 36rem;
  text-align: center;
}

.session-loading img {
  width: 5.6rem;
  height: 3.4rem;
  object-fit: contain;
  margin: 0 auto 1rem;
}

.session-loading h1 {
  margin: 0 0 0.65rem;
  color: var(--ink-strong);
  font-size: 2.6rem;
  line-height: 1;
}

.session-loading p:last-child {
  color: var(--muted);
}

.brand-block {
  max-width: 42rem;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 2.45rem;
  margin-top: 1.2rem;
  border: 1px solid rgba(31, 138, 112, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
  padding: 0 0.95rem;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
}

.auth-back-link:hover {
  border-color: rgba(31, 138, 112, 0.34);
  background: #fff;
  color: var(--ink-strong);
}

.app-logo {
  width: 8rem;
  height: 4.2rem;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 1.3rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 11ch;
  margin-bottom: 1.25rem;
  color: var(--ink-strong);
  font-size: clamp(3.2rem, 6vw, 5.3rem);
  line-height: 0.98;
  font-weight: 800;
  text-wrap: balance;
}

.brand-block p:last-child,
.onboarding-card > p,
.client-selector > p,
.dashboard-heading p,
.module-view-header p,
.workspace-header p {
  color: var(--muted);
  line-height: 1.65;
}

.auth-card,
.onboarding-card,
.client-selector,
.module-card,
.module-view,
.module-empty-state {
  border: 1px solid var(--vintage-line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--vintage-shadow);
}

.auth-card {
  min-width: 0;
  padding: 1.45rem;
}

.language-switcher,
.sidebar-language-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.35rem 0.45rem 0.35rem 0.75rem;
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.language-switcher select,
.sidebar-language-switcher select {
  min-height: 2rem;
  border: 0;
  border-radius: 7px;
  background: var(--ink-strong);
  color: #fff;
  padding: 0 0.55rem;
  font: inherit;
  cursor: pointer;
}

.auth-language-switcher {
  width: 100%;
  margin-bottom: 0.9rem;
}

.gate-language-switcher {
  float: right;
  margin: 0 0 0.75rem 1rem;
}

.workspace-language-switcher {
  flex: 0 0 auto;
}

.sidebar-language-switcher {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
}

.sidebar-language-switcher select {
  background: #fff;
  color: var(--ink-strong);
}

.workspace-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.workspace-gate-card {
  width: min(920px, 100%);
}

.workspace-created-card {
  max-width: 620px;
  text-align: left;
}

.workspace-selector-card {
  max-width: 900px;
}

.gate-logo {
  width: 5.6rem;
  height: 3.2rem;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 1rem;
}

#onboarding-step {
  letter-spacing: 0;
  text-transform: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.35rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.auth-tab {
  min-height: 2.75rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 800;
  white-space: nowrap;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--ink-strong);
  box-shadow: 0 8px 20px rgba(13, 20, 32, 0.08);
}

.stacked-form,
.client-form {
  display: grid;
  gap: 1rem;
}

.form-heading {
  display: grid;
  gap: 0.35rem;
}

.form-heading h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1.35rem;
  line-height: 1.2;
}

.form-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.client-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.form-field {
  display: grid;
  gap: 0.42rem;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-field span {
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea {
  min-height: 3.1rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-strong);
  padding: 0.78rem 0.9rem;
  outline: none;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  padding: 0;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: rgba(31, 138, 112, 0.08);
  color: var(--ink-strong);
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(31, 138, 112, 0.2);
  outline-offset: 2px;
}

.password-icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.14);
}

.form-field textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.5;
}

.image-file-control {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) 1fr;
  gap: 0.9rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 0.75rem;
}

.image-file-preview {
  display: grid;
  place-items: center;
  min-height: 8rem;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.image-file-preview img {
  width: 100%;
  height: 100%;
  max-height: 9rem;
  object-fit: cover;
}

.image-file-preview-empty {
  gap: 0.35rem;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.image-file-preview-empty .ui-icon {
  width: 1.45rem;
  height: 1.45rem;
}

.image-file-actions {
  display: grid;
  gap: 0.55rem;
}

.image-file-actions small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.primary-action,
.secondary-action,
.text-action,
.client-option,
.sidebar-link,
.module-card,
.modal-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
}

.text-action {
  justify-content: flex-start;
  width: auto;
  min-height: 2.5rem;
  margin-top: 0.8rem;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  font-size: 0.9rem;
  box-shadow: none;
}

.text-action:hover {
  color: var(--ink-strong);
  text-decoration: underline;
}

.text-action-inline {
  margin-top: -0.25rem;
}

.primary-action {
  border: 0;
  background: linear-gradient(135deg, var(--ink-strong), #223047);
  color: #fff;
  padding: 0 1.15rem;
  box-shadow: 0 16px 34px rgba(13, 20, 32, 0.18);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-action:hover {
  background: var(--accent-strong);
  box-shadow: 0 18px 40px rgba(15, 111, 88, 0.22);
  transform: translateY(-1px);
}

.module-view .primary-action,
.dashboard-view .primary-action {
  background: linear-gradient(135deg, var(--module-accent, var(--ink-strong)), color-mix(in srgb, var(--module-accent) 62%, #9f7847));
  box-shadow: 0 16px 34px color-mix(in srgb, var(--module-accent) 24%, transparent);
}

.module-view .primary-action:hover,
.dashboard-view .primary-action:hover {
  background: var(--ink-strong);
}

.secondary-action {
  border: 1px solid rgba(184, 137, 84, 0.24);
  background: linear-gradient(135deg, #fffdf8, #ffffff);
  color: var(--ink);
  padding: 0 1rem;
}

.danger-action {
  color: var(--danger);
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.app-alert {
  margin-bottom: 1rem;
  padding: 0.86rem 0.95rem;
  border: 1px solid rgba(180, 35, 24, 0.16);
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.app-alert-success {
  border-color: rgba(6, 118, 71, 0.18);
  background: var(--success-bg);
  color: var(--success);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.mobile-topbar,
.mobile-drawer-overlay,
.mobile-drawer-close,
.mobile-drawer-actions {
  display: none;
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.3rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    var(--sidebar);
  color: #fff;
}

.mobile-drawer-header {
  display: block;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: #fff;
  font-size: 1.22rem;
  font-weight: 800;
  text-decoration: none;
}

.sidebar-brand img {
  width: 3rem;
  height: 2rem;
  object-fit: contain;
}

.workspace-sidebar nav {
  display: grid;
  gap: 0.4rem;
}

.sidebar-link {
  gap: 0.72rem;
  justify-content: flex-start;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 0 0.9rem;
  text-align: left;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sidebar-link .ui-icon {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--module-accent, var(--gold));
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-link.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  background: #fff;
  color: var(--sidebar);
}

.sidebar-link.is-active .ui-icon {
  color: var(--module-accent, var(--accent-strong));
}

.sidebar-link-danger {
  color: #ffd1cc;
}

.workspace-main {
  min-width: 0;
  padding: 2rem;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.workspace-header h2 {
  margin: 0 0 0.35rem;
  color: var(--ink-strong);
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
  font-weight: 800;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
}

.workspace-control {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(20, 32, 51, 0.1);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.workspace-control span:first-child {
  display: block;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-control strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink-strong);
  font-size: 1rem;
}

.onboarding-card,
.client-selector {
  max-width: 900px;
  padding: 1.75rem;
}

.onboarding-card h3,
.client-selector h3,
.dashboard-view h3,
.module-view h3 {
  margin-bottom: 0.65rem;
  color: var(--ink-strong);
  font-size: 2rem;
  line-height: 1.1;
}

.client-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.client-option {
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 1rem;
  text-align: left;
}

.client-option strong,
.client-option span {
  display: block;
}

.client-option span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.client-option > span:first-child {
  min-width: 0;
}

.client-option > span:last-child {
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(31, 138, 112, 0.18);
  border-radius: 999px;
  background: rgba(31, 138, 112, 0.08);
  color: var(--accent-strong);
  padding: 0.38rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.client-option:disabled {
  cursor: default;
  opacity: 0.7;
}

.selector-add-action {
  margin-top: 1rem;
}

.dashboard-view {
  display: grid;
  gap: 1rem;
}

.dashboard-heading,
.module-view-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.5rem;
  border: 1px solid color-mix(in srgb, var(--module-accent) 18%, var(--vintage-line));
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--module-accent) 13%, transparent), transparent 18rem),
    linear-gradient(90deg, color-mix(in srgb, var(--module-accent) 11%, transparent), transparent 42%),
    linear-gradient(135deg, #fffaf0, #ffffff 56%, #f4f9ef);
  box-shadow: var(--vintage-shadow);
}

.dashboard-heading h3,
.module-view-header h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.dashboard-heading h3 .ui-icon,
.module-view-header h3 .ui-icon {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0.45rem;
  border-radius: var(--radius);
  background: var(--module-accent-soft);
  color: var(--module-accent);
}

.workspace-badge,
.module-count-badge,
.status-badge {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--module-accent) 20%, transparent);
  border-radius: 999px;
  background: var(--module-accent-soft);
  color: var(--module-accent);
  padding: 0.44rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.operations-calendar-card {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--vintage-line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fffdf8, #ffffff);
  box-shadow: var(--vintage-shadow);
}

.calendar-card-header,
.calendar-title-row,
.calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.calendar-card-header {
  justify-content: space-between;
}

.calendar-title-row {
  min-width: 0;
}

.calendar-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: rgba(31, 138, 112, 0.1);
  color: var(--accent-strong);
}

.calendar-title-icon .ui-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.calendar-card-header h3 {
  margin: 0.15rem 0 0;
  color: var(--ink-strong);
  font-size: 1.35rem;
  line-height: 1.2;
}

.calendar-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-today-button {
  min-height: 2.35rem;
  padding: 0.55rem 0.8rem;
}

.calendar-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-strong);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.calendar-icon-button:hover {
  border-color: rgba(31, 138, 112, 0.26);
  background: rgba(31, 138, 112, 0.08);
  color: var(--accent-strong);
}

.calendar-month-label {
  min-width: 9.6rem;
  color: var(--ink-strong);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.calendar-weekday {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.45rem;
  min-height: 6.7rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.calendar-day.is-outside-month {
  opacity: 0.48;
}

.calendar-day.is-selected {
  border-color: rgba(31, 138, 112, 0.42);
  box-shadow: inset 0 0 0 1px rgba(31, 138, 112, 0.2);
}

.calendar-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 800;
}

.calendar-day-number:hover {
  background: rgba(31, 138, 112, 0.08);
  color: var(--accent-strong);
}

.calendar-day.is-today .calendar-day-number {
  background: var(--accent);
  color: #ffffff;
}

.calendar-day-events {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  min-width: 0;
}

.calendar-event-chip {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(31, 138, 112, 0.16);
  border-radius: 999px;
  background: rgba(31, 138, 112, 0.09);
  color: var(--accent-strong);
  padding: 0.22rem 0.45rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 800;
}

.calendar-event-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-overflow {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.calendar-selected-panel {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff, #f8fbfa);
}

.calendar-selected-panel h4 {
  margin: 0.15rem 0 0;
  color: var(--ink-strong);
  font-size: 1rem;
}

.calendar-empty-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.calendar-selected-list {
  display: grid;
  gap: 0.45rem;
}

.calendar-selected-event {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.calendar-selected-event:hover {
  border-color: rgba(31, 138, 112, 0.26);
}

.calendar-selected-event-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: rgba(31, 138, 112, 0.08);
  color: var(--accent-strong);
}

.calendar-selected-event strong,
.calendar-selected-event small {
  display: block;
  overflow-wrap: anywhere;
}

.calendar-selected-event strong {
  color: var(--ink-strong);
  font-size: 0.9rem;
}

.calendar-selected-event small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.calendar-add-event {
  min-height: 2.65rem;
}

.module-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
}

.module-header-action {
  min-height: 2.65rem;
}

.module-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.module-card {
  position: relative;
  overflow: hidden;
  flex-direction: column;
  align-items: flex-start;
  min-height: 11.5rem;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--module-accent) 16%, var(--vintage-line));
  background:
    radial-gradient(circle at 84% 12%, color-mix(in srgb, var(--module-accent) 20%, transparent), transparent 7rem),
    linear-gradient(145deg, #fff9eb, #ffffff 58%, #f2f8ee);
  color: var(--ink);
  padding: 1.25rem;
  text-align: left;
  box-shadow: var(--vintage-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.module-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 0.42rem;
  background: linear-gradient(90deg, var(--module-accent), color-mix(in srgb, var(--module-accent) 24%, #e6c28e));
  opacity: 0.9;
}

.module-card:hover {
  border-color: color-mix(in srgb, var(--module-accent) 28%, transparent);
  box-shadow: 0 24px 60px rgba(116, 83, 45, 0.14);
  transform: translateY(-2px);
}

.module-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  margin-bottom: 0.9rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--module-accent) 12%, #fff8ea), #ffffff);
  color: var(--module-accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--module-accent) 18%, var(--vintage-line));
}

.module-card-icon .ui-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.module-card-label {
  color: var(--muted-strong);
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
}

.module-card strong {
  display: block;
  margin: 0.6rem 0;
  color: var(--ink-strong);
  font-size: 2.75rem;
  line-height: 1;
}

.module-card p {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.module-view {
  display: grid;
  gap: 1rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.module-empty-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--module-accent) 8%, transparent), transparent 44%),
    linear-gradient(135deg, #fffdf8, #ffffff);
}

.module-loading {
  padding: 1.5rem;
  border: 1px solid var(--vintage-line);
  border-radius: var(--radius);
  background: var(--surface-warm);
  color: var(--muted);
  font-weight: 800;
  box-shadow: var(--vintage-shadow);
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius);
  background: var(--module-accent-soft);
  color: var(--module-accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.empty-icon .ui-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.module-empty-state h4 {
  margin-bottom: 0.35rem;
  color: var(--ink-strong);
  font-size: 1.2rem;
}

.module-empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.module-record-list {
  display: grid;
  gap: 0.85rem;
}

.record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem;
  border: 1px solid var(--vintage-line);
  border-radius: var(--radius);
  background: var(--surface-warm);
  box-shadow: var(--vintage-shadow);
}

.module-record-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--module-accent) 10%, transparent), transparent 34%),
    linear-gradient(135deg, #fffdf8, #ffffff);
}

.module-record-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--module-accent), #d6a66f);
}

.record-card-main {
  min-width: 0;
}

.record-title-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.record-title-row h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--ink-strong);
  font-size: 1.12rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.record-title-icon {
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid color-mix(in srgb, var(--module-accent) 18%, transparent);
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--module-accent) 12%, #fff8ea), #ffffff);
  color: var(--module-accent);
}

.record-badges,
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.record-badges {
  justify-content: flex-end;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  border-color: var(--line-soft);
  padding: 0.35rem 0.58rem;
  font-size: 0.72rem;
}

.status-badge .ui-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.status-badge-success {
  border-color: rgba(6, 118, 71, 0.2);
  background: var(--success-bg);
  color: var(--success);
}

.status-badge-warning {
  border-color: rgba(184, 137, 84, 0.22);
  background: rgba(184, 137, 84, 0.1);
  color: #8a5b29;
}

.status-badge-danger {
  border-color: rgba(180, 35, 24, 0.18);
  background: var(--danger-bg);
  color: var(--danger);
}

.status-badge-muted {
  border-color: rgba(100, 116, 139, 0.18);
  background: rgba(100, 116, 139, 0.08);
  color: var(--muted-strong);
}

.inventory-category-group.category-produce {
  --category-accent: #15803d;
  --category-soft: rgba(22, 163, 74, 0.14);
  --category-line: rgba(22, 163, 74, 0.26);
}

.inventory-category-icon.category-produce,
.category-badge.category-produce,
.record-title-icon.category-produce {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.inventory-category-group.category-protein {
  --category-accent: #b42318;
  --category-soft: rgba(180, 35, 24, 0.12);
  --category-line: rgba(180, 35, 24, 0.24);
}

.inventory-category-icon.category-protein,
.category-badge.category-protein,
.record-title-icon.category-protein {
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
}

.inventory-category-group.category-dairy {
  --category-accent: #0284c7;
  --category-soft: rgba(14, 165, 233, 0.14);
  --category-line: rgba(14, 165, 233, 0.25);
}

.inventory-category-icon.category-dairy,
.category-badge.category-dairy,
.record-title-icon.category-dairy {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
}

.inventory-category-group.category-seafood {
  --category-accent: #0e7490;
  --category-soft: rgba(8, 145, 178, 0.14);
  --category-line: rgba(8, 145, 178, 0.25);
}

.inventory-category-icon.category-seafood,
.category-badge.category-seafood,
.record-title-icon.category-seafood {
  background: rgba(8, 145, 178, 0.12);
  color: #0e7490;
}

.inventory-category-group.category-dry {
  --category-accent: #8a5b29;
  --category-soft: rgba(184, 137, 84, 0.16);
  --category-line: rgba(184, 137, 84, 0.28);
}

.inventory-category-icon.category-dry,
.category-badge.category-dry,
.record-title-icon.category-dry {
  background: rgba(184, 137, 84, 0.12);
  color: #8a5b29;
}

.inventory-category-group.category-condiment {
  --category-accent: #c2410c;
  --category-soft: rgba(249, 115, 22, 0.14);
  --category-line: rgba(249, 115, 22, 0.26);
}

.inventory-category-icon.category-condiment,
.category-badge.category-condiment,
.record-title-icon.category-condiment {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

.inventory-category-group.category-beverage {
  --category-accent: #0e7490;
  --category-soft: rgba(8, 145, 178, 0.14);
  --category-line: rgba(8, 145, 178, 0.25);
}

.inventory-category-icon.category-beverage,
.category-badge.category-beverage,
.record-title-icon.category-beverage {
  background: rgba(8, 145, 178, 0.12);
  color: #0e7490;
}

.inventory-category-group.category-frozen {
  --category-accent: #1d4ed8;
  --category-soft: rgba(37, 99, 235, 0.12);
  --category-line: rgba(37, 99, 235, 0.24);
}

.inventory-category-icon.category-frozen,
.category-badge.category-frozen,
.record-title-icon.category-frozen {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.inventory-category-group.category-canned {
  --category-accent: #475569;
  --category-soft: rgba(100, 116, 139, 0.14);
  --category-line: rgba(100, 116, 139, 0.24);
}

.inventory-category-icon.category-canned,
.category-badge.category-canned,
.record-title-icon.category-canned {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.inventory-category-group.category-supplies {
  --category-accent: #334155;
  --category-soft: rgba(71, 85, 105, 0.12);
  --category-line: rgba(71, 85, 105, 0.22);
}

.inventory-category-icon.category-supplies,
.category-badge.category-supplies,
.record-title-icon.category-supplies {
  background: rgba(71, 85, 105, 0.1);
  color: #334155;
}

.inventory-category-group.category-other {
  --category-accent: #4f46e5;
  --category-soft: rgba(79, 70, 229, 0.12);
  --category-line: rgba(79, 70, 229, 0.24);
}

.inventory-category-icon.category-other,
.category-badge.category-other,
.record-title-icon.category-other {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}

.inventory-category-group.category-subrecipe {
  --category-accent: #7c3aed;
  --category-soft: rgba(124, 58, 237, 0.13);
  --category-line: rgba(124, 58, 237, 0.24);
}

.inventory-category-icon.category-subrecipe,
.category-badge.category-subrecipe,
.record-title-icon.category-subrecipe {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.record-meta-chip {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  padding: 0.32rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.record-details {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.95rem;
}

.record-detail {
  display: grid;
  gap: 0.25rem;
}

.record-detail span {
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.record-detail p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.record-actions {
  justify-content: flex-end;
}

.inventory-category-list {
  display: grid;
  gap: 0.9rem;
}

.inventory-category-group {
  --category-accent: #16a34a;
  --category-soft: rgba(22, 163, 74, 0.12);
  --category-line: rgba(22, 163, 74, 0.28);
  overflow: hidden;
  border: 1px solid var(--category-line);
  border-radius: var(--radius);
  background: var(--surface-warm);
  box-shadow: var(--vintage-shadow);
}

.inventory-category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--category-line);
  background:
    radial-gradient(circle at 100% 0, var(--category-soft), transparent 11rem),
    linear-gradient(90deg, var(--category-soft), #fff8ec 72%, #ffffff);
}

.inventory-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff7e8, #ffffff);
  color: var(--category-accent);
  box-shadow: inset 0 0 0 1px var(--category-line);
}

.inventory-category-header h4 {
  margin: 0;
  color: var(--category-accent);
  font-size: 1.02rem;
}

.inventory-category-header p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.inventory-ingredient-list {
  display: grid;
}

.inventory-ingredient-row {
  display: grid;
  grid-template-columns: minmax(15rem, 1.2fr) minmax(18rem, 1fr) minmax(10rem, auto) auto;
  gap: 0.85rem;
  align-items: center;
  min-height: 4.2rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.72), transparent 42%),
    #fff;
  transition: background-color 0.2s ease;
}

.inventory-ingredient-row:hover {
  background:
    linear-gradient(90deg, var(--category-soft), transparent 38%),
    #fffdf8;
}

.inventory-ingredient-row:last-child {
  border-bottom: 0;
}

.inventory-ingredient-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.inventory-ingredient-main .record-title-icon {
  border-color: rgba(184, 137, 84, 0.18);
  background: #fff8ea;
  color: var(--muted-strong);
}

.inventory-ingredient-main strong,
.inventory-ingredient-main span {
  display: block;
  overflow-wrap: anywhere;
}

.inventory-ingredient-main strong {
  color: var(--ink-strong);
  font-size: 0.98rem;
}

.inventory-ingredient-main span {
  margin-top: 0.16rem;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.inventory-ingredient-metrics,
.inventory-ingredient-status,
.inventory-ingredient-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
}

.inventory-ingredient-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--muted-strong);
  padding: 0.25rem 0.52rem;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-ingredient-metrics .ui-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.inventory-ingredient-actions .icon-only-button {
  width: 2.35rem;
  min-height: 2.35rem;
}

.recipe-inline-list {
  display: grid;
  gap: 1rem;
}

.recipe-inline-card {
  grid-template-columns: 1fr;
  gap: 1.05rem;
}

.recipe-inline-card-header,
.recipe-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.recipe-inline-title-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.recipe-inline-title-block .eyebrow {
  margin-bottom: 0.25rem;
  color: var(--module-accent);
}

.recipe-inline-card-header h4 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1.18rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.recipe-inline-name-field {
  max-width: 42rem;
}

.recipe-inline-ingredients {
  display: grid;
  gap: 0.85rem;
}

.recipe-inline-ingredient-rows {
  display: grid;
  gap: 0.6rem;
}

.recipe-inline-add-ingredient {
  width: fit-content;
}

.recipe-inline-actions {
  justify-content: flex-start;
}

.recipe-summary-list {
  display: grid;
  gap: 0.85rem;
}

.recipe-summary-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.recipe-summary-photo,
.recipe-summary-photo-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5.25rem;
  height: 5.25rem;
  border: 1px solid var(--vintage-line);
  border-radius: var(--radius);
  background: var(--surface-warm);
  color: var(--module-accent);
  overflow: hidden;
}

.recipe-summary-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-summary-photo-empty {
  background: linear-gradient(135deg, color-mix(in srgb, var(--module-accent) 12%, #fff8ea), #ffffff);
}

.recipe-summary-photo-empty .ui-icon {
  width: 1.8rem;
  height: 1.8rem;
}

.recipe-summary-main {
  min-width: 0;
}

.recipe-summary-main .eyebrow {
  margin-bottom: 0.25rem;
  color: var(--module-accent);
}

.recipe-summary-main h4 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1.2rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.recipe-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.recipe-summary-actions {
  justify-content: flex-end;
}

.module-form-detail-mode {
  padding-top: 0;
}

.recipe-detail-view {
  display: grid;
  gap: 1rem;
}

.recipe-detail-hero {
  display: grid;
  grid-template-columns: minmax(13rem, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  align-items: stretch;
}

.recipe-detail-photo,
.recipe-detail-photo-empty {
  min-height: 14rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-warm);
  overflow: hidden;
}

.recipe-detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-detail-photo-empty {
  display: grid;
  place-items: center;
  gap: 0.45rem;
  color: var(--muted-strong);
  font-weight: 800;
}

.recipe-detail-photo-empty .ui-icon {
  width: 2rem;
  height: 2rem;
  color: var(--module-accent);
}

.recipe-detail-overview {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.recipe-detail-overview .record-badges {
  justify-content: flex-start;
}

.recipe-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.recipe-detail-meta-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-warm);
}

.recipe-detail-meta-item span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.recipe-detail-meta-item .ui-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.recipe-detail-meta-item strong {
  color: var(--ink-strong);
  overflow-wrap: anywhere;
}

.recipe-detail-section {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.recipe-detail-section h4 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1rem;
}

.recipe-detail-section p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.55;
  white-space: pre-wrap;
}

.recipe-detail-actions {
  display: flex;
  justify-content: flex-end;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.report-card {
  min-height: 8.5rem;
  padding: 1.15rem;
  border: 1px solid rgba(20, 32, 51, 0.1);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.report-card span {
  display: block;
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-card strong {
  display: block;
  margin-top: 0.8rem;
  color: var(--ink-strong);
  font-size: 2.55rem;
  line-height: 1;
}

.module-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(13, 23, 38, 0.58);
}

.module-modal {
  width: min(780px, 100%);
  max-height: min(820px, calc(100vh - 2.5rem));
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.module-modal * {
  min-width: 0;
}

.module-modal[data-modal-section="subrecipes"] {
  width: min(980px, 100%);
}

.module-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.35rem 1.35rem 0;
}

.module-modal-header h3 {
  margin: 0 0 0.35rem;
  color: var(--ink-strong);
  font-size: 1.7rem;
  line-height: 1.1;
}

.module-modal-header p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-icon-button {
  min-height: 2.4rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 0.75rem;
  font-size: 0.82rem;
}

.module-form {
  display: grid;
  gap: 1.15rem;
  padding: 1.35rem;
}

.module-modal .app-alert {
  margin: 1rem 1.35rem 0;
}

.workspace-modal .workspace-switcher-list {
  display: grid;
  gap: 0.8rem;
  padding: 1.35rem 1.35rem 0;
}

.module-form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field-readonly input,
.form-field-readonly textarea {
  background: var(--surface-subtle);
  color: var(--muted-strong);
  cursor: default;
}

.form-section-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.15rem 0 0.2rem;
  border-bottom: 1px solid var(--line-soft);
}

.form-section-heading span {
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recipe-ingredient-builder,
.inventory-recipe-link-panel {
  display: grid;
  gap: 0.95rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.recipe-builder-heading {
  display: grid;
  gap: 0.25rem;
}

.recipe-builder-heading span {
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 800;
}

.recipe-builder-heading p,
.recipe-ingredient-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.recipe-builder-panel {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.recipe-builder-panel-heading {
  display: grid;
  gap: 0.22rem;
}

.recipe-builder-panel-heading strong {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-strong);
  font-size: 0.9rem;
}

.recipe-builder-panel-heading > span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.recipe-ingredient-picker,
.recipe-manual-ingredient-picker,
.recipe-create-inventory-picker,
.recipe-quick-add-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(6.5rem, 0.5fr) minmax(6.5rem, 0.5fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.recipe-manual-ingredient-picker {
  grid-template-columns: minmax(0, 1.5fr) minmax(6.5rem, 0.45fr) minmax(6.5rem, 0.45fr) auto;
}

.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-builder {
  overflow-x: hidden;
}

.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-picker {
  grid-template-columns: minmax(10rem, 1.15fr) minmax(11rem, 1.15fr) minmax(5rem, 0.42fr) minmax(5.7rem, 0.45fr) auto;
  gap: 0.55rem;
}

.module-modal[data-modal-section="subrecipes"] .recipe-create-inventory-picker {
  grid-template-columns: minmax(10rem, 1.25fr) minmax(8.5rem, 0.85fr) minmax(6rem, 0.5fr) minmax(6rem, 0.5fr) minmax(5.8rem, 0.45fr) auto;
  gap: 0.55rem;
}

.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-picker .secondary-action,
.module-modal[data-modal-section="subrecipes"] .recipe-create-inventory-picker .primary-action {
  min-height: 2.75rem;
  white-space: nowrap;
}

.module-modal[data-modal-section="subrecipes"] .form-field input,
.module-modal[data-modal-section="subrecipes"] .form-field select,
.module-modal[data-modal-section="subrecipes"] .form-field textarea {
  text-overflow: ellipsis;
}

.recipe-quick-add-toggle {
  margin: 0;
}

.recipe-quick-add-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  padding: 1rem;
  border: 1px solid rgba(31, 138, 112, 0.16);
  border-radius: var(--radius);
  background: #fff;
}

.inventory-duplicate-suggestion {
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem;
  border: 1px solid rgba(184, 137, 84, 0.22);
  border-radius: var(--radius);
  background: rgba(184, 137, 84, 0.1);
}

.inventory-duplicate-suggestion:empty {
  display: none;
}

.inventory-duplicate-suggestion strong {
  color: #8a5b29;
  font-size: 0.88rem;
}

.inventory-duplicate-suggestion span {
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 800;
}

.inventory-duplicate-suggestion .text-action {
  margin: 0;
}

.recipe-quick-add-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  grid-column: 1 / -1;
}

.recipe-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.recipe-ingredient-list {
  display: grid;
  gap: 0.6rem;
}

.recipe-ingredient-table-head {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(5.5rem, 0.25fr) minmax(6.5rem, 0.25fr) minmax(14rem, 0.55fr) auto;
  gap: 0.75rem;
  padding: 0 0.75rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.recipe-builder-ingredient-table-head {
  grid-template-columns: minmax(12rem, 1fr) minmax(5.5rem, 0.22fr) minmax(7rem, 0.28fr) minmax(13rem, 0.55fr) minmax(6.5rem, 0.25fr) minmax(4.5rem, auto);
}

.recipe-ingredient-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(5.5rem, 0.25fr) minmax(6.5rem, 0.25fr) minmax(14rem, 0.55fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.recipe-builder-ingredient-row {
  grid-template-columns: minmax(12rem, 1fr) minmax(5.5rem, 0.22fr) minmax(7rem, 0.28fr) minmax(13rem, 0.55fr) minmax(6.5rem, 0.25fr) minmax(4.5rem, auto);
}

.module-modal[data-modal-section="subrecipes"] .recipe-builder-ingredient-list-subrecipe {
  max-width: 100%;
  overflow: hidden;
}

.module-modal[data-modal-section="recipes"] .recipe-builder-ingredient-list-recipe {
  max-width: 100%;
  overflow: hidden;
}

.module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-card,
.module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(260px, 1fr) minmax(130px, auto);
  gap: 0.9rem;
  align-items: end;
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, #ffffff 0%, #fffdf8 100%);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.055);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-card:hover,
.module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-card:hover {
  border-color: rgba(90, 64, 168, 0.22);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.075);
  transform: translateY(-1px);
}

.module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-card > *,
.module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-card > * {
  min-width: 0;
}

.module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-main,
.module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-main {
  display: contents;
}

.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-name-field,
.module-modal[data-modal-section="recipes"] .recipe-ingredient-name-field {
  min-width: 0;
}

.module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-fields,
.module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-fields {
  display: grid;
  grid-template-columns: minmax(64px, 0.7fr) minmax(82px, 0.8fr) minmax(112px, 1fr);
  gap: 0.55rem;
  align-items: end;
  min-width: 0;
}

.module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-fields > *,
.module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-fields > * {
  min-width: 0;
}

.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-name-field input,
.module-modal[data-modal-section="recipes"] .recipe-ingredient-name-field input {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink-strong);
  background: #fff;
}

.module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-card label > span,
.module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-card label > span,
.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-line-cost span,
.module-modal[data-modal-section="recipes"] .recipe-ingredient-line-cost span,
.module-modal[data-modal-section="subrecipes"] .inventory-status-cell::before {
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-line-cost,
.module-modal[data-modal-section="recipes"] .recipe-ingredient-line-cost {
  display: grid;
  gap: 0.15rem;
  min-width: 6.8rem;
  max-width: 7.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(90, 64, 168, 0.13);
  border-radius: var(--radius);
  background: rgba(90, 64, 168, 0.06);
  overflow: hidden;
  justify-items: end;
}

.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-line-cost span,
.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-line-cost strong,
.module-modal[data-modal-section="recipes"] .recipe-ingredient-line-cost span,
.module-modal[data-modal-section="recipes"] .recipe-ingredient-line-cost strong {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
}

.module-modal[data-modal-section="subrecipes"] .recipe-ingredient-line-cost strong,
.module-modal[data-modal-section="recipes"] .recipe-ingredient-line-cost strong {
  color: var(--ink-strong);
  font-size: 1.05rem;
  font-weight: 900;
}

.module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-actions,
.module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 0.6rem;
  min-width: 0;
  width: auto;
  padding-top: 0;
  border-top: 0;
}

.module-modal[data-modal-section="subrecipes"] .ingredient-delete-btn,
.module-modal[data-modal-section="recipes"] .ingredient-delete-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 244, 242, 0.82);
  color: var(--danger);
  box-shadow: none;
}

.module-modal[data-modal-section="subrecipes"] .ingredient-delete-btn:hover,
.module-modal[data-modal-section="recipes"] .ingredient-delete-btn:hover {
  border-color: rgba(180, 35, 24, 0.36);
  background: var(--danger-bg);
  color: #8f1d15;
  transform: none;
}


@media (max-width: 900px) {
  .module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-main,
  .module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-main {
    grid-template-columns: 1fr;
  }

  .module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-fields,
  .module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-main,
  .module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-fields,
  .module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-main,
  .module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-fields {
    grid-template-columns: 1fr;
  }
}

.recipe-ingredient-row strong,
.recipe-ingredient-row span,
.recipe-ingredient-row label span {
  display: block;
}

.recipe-ingredient-row strong {
  color: var(--ink-strong);
}

.recipe-ingredient-row span,
.recipe-ingredient-row label span {
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.recipe-ingredient-row input,
.recipe-ingredient-row select {
  min-height: 2.5rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.65rem;
}

.recipe-ingredient-line-cost {
  display: grid;
  gap: 0.25rem;
}

.recipe-ingredient-line-cost strong {
  color: var(--ink-strong);
  font-size: 0.94rem;
}

.recipe-ingredient-name-field small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.inventory-status-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.module-modal[data-modal-section="subrecipes"] .inventory-status-cell {
  gap: 0.35rem;
  align-content: end;
  align-items: flex-end;
  min-width: 0;
  overflow: hidden;
}

.module-modal[data-modal-section="subrecipes"] .inventory-status-pill {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.module-modal[data-modal-section="subrecipes"] .inventory-status-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-status-pill {
  min-height: 2.2rem;
  padding: 0.35rem 0.58rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-status-pill.is-connected {
  border-color: rgba(31, 138, 112, 0.18);
  background: rgba(31, 138, 112, 0.08);
  color: var(--accent-strong);
}

.inventory-status-pill.is-missing {
  border-color: rgba(184, 137, 84, 0.24);
  background: rgba(184, 137, 84, 0.1);
  color: #8a5b29;
}

.inventory-status-pill.is-subrecipe {
  border-color: rgba(70, 84, 102, 0.16);
  background: rgba(70, 84, 102, 0.08);
}

.compact-icon-action {
  min-height: 2.2rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.recipe-add-inventory-action {
  white-space: nowrap;
}

.subrecipe-modal-icon-action {
  flex: 0 0 auto;
}

.recipe-cost-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.recipe-cost-summary div {
  padding: 0.8rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.recipe-cost-summary span,
.recipe-ingredient-summary > span {
  display: block;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.recipe-cost-summary strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-strong);
  font-size: 1.1rem;
}

.recipe-ingredient-summary {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.95rem;
}

.recipe-ingredient-summary ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recipe-ingredient-summary li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.recipe-ingredient-summary li span:first-child {
  color: var(--ink-strong);
  font-weight: 800;
}

.recipe-ingredient-summary li span:last-child {
  color: var(--muted-strong);
  font-weight: 800;
}

.recipe-detail-ingredient-table {
  display: grid;
  gap: 0.5rem;
}

.recipe-detail-ingredient-head,
.recipe-detail-ingredient-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(7rem, 0.35fr) minmax(10rem, 0.5fr) minmax(6rem, 0.25fr);
  gap: 0.75rem;
  align-items: center;
}

.recipe-detail-ingredient-head {
  padding: 0 0.65rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recipe-detail-ingredient-row {
  padding: 0.7rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.recipe-detail-ingredient-row strong {
  color: var(--ink-strong);
}

.recipe-detail-ingredient-row > span,
.recipe-detail-ingredient-row div span {
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.module-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  max-width: min(24rem, calc(100vw - 2rem));
  border: 1px solid rgba(31, 138, 112, 0.22);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-strong);
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow-panel);
  font-weight: 800;
}

@media (max-width: 1080px) {
  .module-card-grid,
  .reports-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-ingredient-row {
    grid-template-columns: minmax(14rem, 1fr) minmax(16rem, 1fr);
  }

  .inventory-ingredient-status,
  .inventory-ingredient-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .calendar-card-header,
  .calendar-selected-panel {
    display: grid;
  }

  .calendar-controls {
    justify-content: flex-start;
  }

  .calendar-selected-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .module-card-grid,
  .reports-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-ingredient-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .recipe-ingredient-picker,
  .recipe-manual-ingredient-picker,
  .recipe-create-inventory-picker,
  .recipe-builder-ingredient-table-head,
  .recipe-builder-ingredient-row,
  .recipe-detail-ingredient-head,
  .recipe-detail-ingredient-row {
    grid-template-columns: 1fr;
  }

  .module-modal[data-modal-section="subrecipes"] .recipe-ingredient-picker,
  .module-modal[data-modal-section="subrecipes"] .recipe-create-inventory-picker,
  .module-modal[data-modal-section="subrecipes"] .recipe-builder-ingredient-table-head,
  .module-modal[data-modal-section="subrecipes"] .recipe-builder-ingredient-row {
    grid-template-columns: 1fr;
  }

  .module-modal[data-modal-section="subrecipes"] .recipe-builder-ingredient-table-head {
    display: none;
  }

  .module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-fields {
    grid-template-columns: 1fr 1fr;
  }

  .module-modal[data-modal-section="subrecipes"] .inventory-status-cell {
    display: grid;
    align-items: flex-start;
    justify-items: start;
    grid-column: 1 / -1;
  }

  .module-modal[data-modal-section="subrecipes"] .inventory-status-cell::before {
    content: "Inventory";
    color: var(--muted-strong);
    font-size: 0.78rem;
    font-weight: 800;
  }

  .module-modal[data-modal-section="subrecipes"] .recipe-ingredient-line-cost {
    justify-items: start;
    max-width: 100%;
  }

  .module-modal[data-modal-section="subrecipes"] .recipe-ingredient-line-cost span,
  .module-modal[data-modal-section="subrecipes"] .recipe-ingredient-line-cost strong {
    text-align: left;
  }

  .module-modal[data-modal-section="subrecipes"] .subrecipe-ingredient-actions {
    justify-content: space-between;
    width: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line-soft);
  }

  .module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-fields {
    grid-template-columns: 1fr 1fr;
  }

  .module-modal[data-modal-section="recipes"] .inventory-status-cell {
    display: grid;
    align-items: flex-start;
    justify-items: start;
    grid-column: 1 / -1;
  }

  .module-modal[data-modal-section="recipes"] .inventory-status-cell::before {
    content: "Inventory";
    color: var(--muted-strong);
    font-size: 0.78rem;
    font-weight: 800;
  }

  .module-modal[data-modal-section="recipes"] .recipe-ingredient-line-cost {
    justify-items: start;
    max-width: 100%;
  }

  .module-modal[data-modal-section="recipes"] .recipe-ingredient-line-cost span,
  .module-modal[data-modal-section="recipes"] .recipe-ingredient-line-cost strong {
    text-align: left;
  }

  .module-modal[data-modal-section="recipes"] .recipe-edit-ingredient-actions {
    justify-content: space-between;
    width: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line-soft);
  }

  .inventory-ingredient-metrics,
  .inventory-ingredient-status,
  .inventory-ingredient-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 2rem 0;
  }

  .auth-card {
    width: min(24rem, calc(100vw - 32px));
  }

  .auth-tab {
    font-size: 0.82rem;
  }

  .workspace-main {
    padding: 1rem;
  }

  .operations-calendar-card {
    padding: 1rem;
  }

  .calendar-controls {
    gap: 0.45rem;
  }

  .calendar-controls .secondary-action {
    width: auto;
  }

  .calendar-month-label {
    min-width: 7.5rem;
    font-size: 0.85rem;
  }

  .calendar-grid {
    gap: 0.32rem;
  }

  .calendar-weekday {
    font-size: 0.62rem;
  }

  .calendar-day {
    min-height: 4.8rem;
    padding: 0.35rem;
  }

  .calendar-day-number {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.78rem;
  }

  .calendar-event-chip {
    padding: 0.18rem 0.32rem;
    font-size: 0.62rem;
  }

  .workspace-header,
  .dashboard-heading,
  .workspace-control,
  .module-view-header,
  .module-modal-header,
  .record-title-row,
  .record-card {
    display: grid;
  }

  .header-actions,
  .module-header-actions,
  .record-actions,
  .recipe-summary-actions,
  .modal-actions,
  .secondary-action {
    width: 100%;
  }

  .client-form,
  .module-card-grid,
  .module-empty-state,
  .module-form-fields,
  .recipe-ingredient-picker,
  .recipe-manual-ingredient-picker,
  .recipe-create-inventory-picker,
  .recipe-builder-ingredient-table-head,
  .recipe-builder-ingredient-row,
  .recipe-detail-ingredient-head,
  .recipe-detail-ingredient-row,
  .recipe-summary-card,
  .recipe-detail-hero,
  .recipe-detail-meta-grid,
  .image-file-control,
  .recipe-quick-add-panel,
  .recipe-ingredient-table-head,
  .recipe-ingredient-row,
  .recipe-cost-summary,
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .module-modal[data-modal-section="subrecipes"] .recipe-ingredient-picker,
  .module-modal[data-modal-section="subrecipes"] .recipe-create-inventory-picker,
  .module-modal[data-modal-section="subrecipes"] .recipe-builder-ingredient-table-head,
  .module-modal[data-modal-section="subrecipes"] .recipe-builder-ingredient-row {
    grid-template-columns: 1fr;
  }

  .workspace-gate {
    align-items: flex-start;
    padding: 1rem;
  }

  .workspace-gate-card {
    margin-top: 5rem;
  }

  .module-empty-state .primary-action,
  .module-header-action,
  .selector-add-action,
  .modal-actions .primary-action,
  .modal-actions .secondary-action,
  .record-actions .secondary-action {
    width: 100%;
  }

  .client-option {
    display: grid;
  }

  .client-option > span:last-child {
    width: fit-content;
  }

  .record-badges {
    justify-content: flex-start;
  }

  .recipe-summary-photo,
  .recipe-summary-photo-empty {
    width: 100%;
    height: 10rem;
  }

  .recipe-summary-actions,
  .recipe-detail-actions {
    justify-content: stretch;
  }

  .recipe-summary-actions .primary-action,
  .recipe-summary-actions .secondary-action,
  .recipe-detail-actions .primary-action {
    width: 100%;
  }

  .recipe-inline-card-header,
  .recipe-inline-actions {
    display: grid;
    justify-content: stretch;
  }

  .recipe-inline-add-ingredient,
  .recipe-inline-actions .primary-action,
  .recipe-inline-actions .secondary-action {
    width: 100%;
  }

  .module-modal[data-modal-section="subrecipes"] .subrecipe-modal-icon-action span:not(.visually-hidden) {
    display: none;
  }

  .module-modal[data-modal-section="subrecipes"] .subrecipe-modal-icon-action {
    width: 2.75rem;
    justify-self: start;
  }

  .recipe-ingredient-table-head {
    display: none;
  }

  .recipe-quick-add-actions,
  .recipe-ingredient-row {
    align-items: stretch;
  }

  .recipe-quick-add-actions {
    display: grid;
  }

  .module-modal-backdrop {
    align-items: end;
    padding: 0.75rem;
  }

  .module-modal {
    max-height: calc(100vh - 1.5rem);
  }

  .brand-block {
    display: none;
  }
}

@media (max-width: 860px) {
  .workspace-shell {
    display: block;
    min-height: 100vh;
    padding-top: 4.35rem;
  }

  .mobile-topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4.35rem;
    border-bottom: 1px solid rgba(20, 32, 51, 0.1);
    background: rgba(244, 247, 250, 0.94);
    padding: 0.75rem 1rem;
    backdrop-filter: blur(18px);
  }

  .mobile-topbar-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 0.65rem;
    color: var(--ink-strong);
    font-weight: 800;
    text-decoration: none;
  }

  .mobile-topbar-brand img {
    flex: 0 0 auto;
    width: 2.7rem;
    height: 1.8rem;
    object-fit: contain;
  }

  .mobile-topbar-brand span {
    min-width: 0;
    max-width: calc(100vw - 8rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-button,
  .mobile-drawer-close {
    flex: 0 0 auto;
    border: 1px solid rgba(20, 32, 51, 0.14);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink-strong);
    cursor: pointer;
  }

  .mobile-menu-button {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    width: 2.8rem;
    height: 2.8rem;
    padding: 0;
    box-shadow: var(--shadow-soft);
  }

  .mobile-menu-button span {
    display: block;
    width: 1.1rem;
    height: 2px;
    margin: 0 auto;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    background: rgba(13, 20, 32, 0.56);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .mobile-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(82vw, 22rem);
    max-width: 82vw;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s ease;
  }

  .workspace-sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
  }

  .mobile-drawer-header .sidebar-brand {
    margin-bottom: 0;
  }

  .mobile-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
  }

  .workspace-sidebar nav,
  .mobile-drawer-actions {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 0.35rem;
  }

  .mobile-drawer-actions {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidebar-link {
    justify-content: flex-start;
    min-height: 2.75rem;
    padding: 0 0.85rem;
    text-align: left;
  }

  .workspace-main {
    width: 100%;
    min-width: 0;
    padding: 1rem;
  }

  .workspace-header {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
  }

  .workspace-header h2 {
    font-size: clamp(1.9rem, 11vw, 3.25rem);
  }

  .header-actions {
    display: none;
  }

  .dashboard-heading,
  .workspace-control,
  .module-view-header {
    display: grid;
  }

  .module-card-grid,
  .reports-grid,
  .client-form,
  .module-form-fields {
    grid-template-columns: 1fr;
  }

  .module-card,
  .module-empty-state,
  .record-card,
  .form-field,
  .form-field input,
  .form-field select,
  .form-field textarea {
    max-width: 100%;
  }
}
