@layer brewery-components {
  @scope (.brewery) {
    .section {
      min-width: 0;
      margin: 0;
      border: 1px solid var(--line);
      border-radius: calc(var(--radius) + 0.2rem);
      background: var(--panel);
    }
    .section--danger {
      border-color: color-mix(in srgb, var(--danger) 50%, var(--line));
    }
    .section--danger .section__title {
      color: var(--danger);
    }
    .section__head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 1rem;
      padding: 0.9rem 1.1rem 0.8rem;
      border-bottom: 1px solid var(--line);
    }
    .section__head:last-child {
      align-items: center;
      border-bottom: 0;
    }
    .section__heading {
      min-width: 0;
    }
    .section__title {
      margin: 0;
      font-size: 1rem;
      font-weight: 650;
      letter-spacing: 0;
    }
    .section__description {
      margin: 0.15rem 0 0;
      color: var(--muted);
      font-size: 0.875rem;
    }
    .section__body {
      display: grid;
      gap: 1rem;
      min-width: 0;
      padding: 1.1rem;
    }
    .section__flush {
      min-width: 0;
    }
    .section__flush > * + * {
      border-top: 1px solid var(--line);
    }
    .section__foot {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-end;
      gap: 0.5rem 1rem;
      padding: 0.65rem 1.1rem;
      border-top: 1px solid var(--line);
      border-radius: 0 0 calc(var(--radius) + 0.2rem)
        calc(var(--radius) + 0.2rem);
      background: color-mix(in srgb, var(--fg) 2.5%, transparent);
    }
    .section__note {
      margin: 0 auto 0 0;
      color: var(--muted);
      font-size: 0.8125rem;
    }
    .section__body {
      font-size: 0.9375rem;
    }
    .section .button {
      min-height: 2.15rem;
      padding: 0.4rem 0.9rem;
      font-size: 0.875rem;
    }

    .field {
      display: grid;
      gap: 0.35rem;
      min-width: 0;
    }
    .field__label {
      display: block;
      margin: 0;
      color: var(--fg);
      font-size: 0.875rem;
      font-weight: 600;
    }
    .field__label.visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
    .field__control {
      display: block;
      width: 100%;
      max-width: none;
      height: 2.25rem;
      margin: 0;
      padding: 0.4rem 0.65rem;
      font-size: 0.9375rem;
      font-weight: 400;
    }
    .field__control--area {
      height: auto;
      min-height: 6rem;
      resize: vertical;
    }
    .field__control[type="file"] {
      height: auto;
      padding: 0.3rem;
      color: var(--muted);
      font-size: 0.875rem;
    }
    .field__control[type="file"]::file-selector-button {
      margin-right: 0.75rem;
      padding: 0.3rem 0.75rem;
      border: 1px solid var(--border-control);
      border-radius: var(--radius);
      background: var(--panel);
      color: var(--fg);
      font: inherit;
      font-weight: 600;
      cursor: pointer;
    }
    .field__control[type="color"] {
      padding: 0.25rem;
      cursor: pointer;
    }
    .field__control[type="color"]::-webkit-color-swatch-wrapper {
      padding: 0;
    }
    .field__control[type="color"]::-webkit-color-swatch {
      border: 0;
      border-radius: calc(var(--radius) - 0.15rem);
    }
    .field__control[type="color"]::-moz-color-swatch {
      border: 0;
      border-radius: calc(var(--radius) - 0.15rem);
    }
    .field__hint {
      margin: 0;
      color: var(--muted);
      font-size: 0.8125rem;
    }
    .field-row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
      align-items: start;
      gap: 1rem;
    }
    .field-group {
      display: grid;
      gap: 0.6rem;
      min-width: 0;
      margin: 0;
      padding: 0;
      border: 0;
    }
    .field-group__legend {
      float: left;
      width: 100%;
      margin: 0;
      padding: 0;
      font-size: 0.875rem;
      font-weight: 600;
    }
    .field-group__hint {
      margin: -0.35rem 0 0;
      color: var(--muted);
      font-size: 0.8125rem;
    }
    .field-group__body {
      display: grid;
      gap: 0.6rem;
      min-width: 0;
    }

    .check {
      display: flex;
      align-items: flex-start;
      gap: 0.6rem;
      margin: 0;
      font-size: 0.9375rem;
      font-weight: 500;
      cursor: pointer;
    }
    .check > .check__box {
      margin: calc((1lh - 1rem) / 2) 0 0;
    }
    .check-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem 1.5rem;
    }
    .check__text {
      display: grid;
      gap: 0.1rem;
      min-width: 0;
    }
    .check__hint {
      color: var(--muted);
      font-size: 0.8125rem;
      font-weight: 400;
    }

    .list-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem 1rem;
      min-width: 0;
      padding: 0.75rem 1.1rem;
    }
    .list-row__main {
      display: grid;
      flex: 1 1 16rem;
      gap: 0.15rem;
      min-width: 0;
    }
    .list-row__title {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.5rem;
      font-weight: 600;
      overflow-wrap: anywhere;
    }
    .list-row__main .muted,
    .list-row__main p {
      margin: 0;
      color: var(--muted);
      font-size: 0.85rem;
      overflow-wrap: anywhere;
    }
    .list-row__main p:empty {
      display: none;
    }
    .list-row__actions {
      display: flex;
      flex: none;
      align-items: center;
      gap: 0.5rem;
      color: var(--muted);
      font-size: 0.875rem;
    }
    .list-row__actions form {
      margin: 0;
    }
    .list-row__actions .button,
    .list-row__actions button {
      min-height: 2rem;
      padding: 0.3rem 0.7rem;
      font-size: 0.8125rem;
    }
    .section-list {
      min-width: 0;
      border: 1px solid var(--line);
      border-radius: var(--radius);
    }
    .section-list:empty {
      display: none;
    }
    .section-list > * + * {
      border-top: 1px solid var(--line);
    }
    .section-list .list-row {
      padding: 0.65rem 0.85rem;
    }
    .stat-list {
      margin: 0;
    }
    .stat-list__row {
      display: flex;
      justify-content: space-between;
      gap: 1rem;
      padding: 0.6rem 1.1rem;
      font-size: 0.9rem;
    }
    .stat-list__row + .stat-list__row {
      border-top: 1px solid var(--line);
    }
    .stat-list__label {
      min-width: 0;
      color: var(--muted);
      overflow-wrap: anywhere;
    }
    .stat-list__value {
      margin: 0;
      font-variant-numeric: tabular-nums;
      font-weight: 600;
      text-align: right;
    }
    .list-empty {
      margin: 0;
      padding: 1rem 1.1rem;
      color: var(--muted);
      font-size: 0.9rem;
    }

    .settings-frame {
      display: grid;
      grid-template-columns: 14.5rem minmax(0, 1fr);
      align-items: start;
      gap: 2rem;
      margin: 0.75rem 0 1.5rem;
    }
    .settings-frame__aside {
      position: sticky;
      top: calc(var(--header-height) + 1rem);
      display: grid;
      gap: 1rem;
      min-width: 0;
    }
    .settings-frame__main {
      display: grid;
      gap: 1rem;
      min-width: 0;
      max-width: 52rem;
    }
    .settings-frame__title {
      margin: 0;
    }
    .settings-frame__sections {
      display: grid;
      gap: 1.25rem;
      min-width: 0;
    }
    .settings-menu {
      display: grid;
      gap: 1rem;
      color: inherit;
    }
    .settings-menu__group {
      display: grid;
      gap: 0.1rem;
    }
    .settings-menu__title {
      margin: 0 0 0.2rem;
      padding: 0 0.65rem;
      color: var(--faint);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .settings-menu__link {
      padding: 0.4rem 0.65rem;
      border-radius: var(--radius);
      color: var(--muted);
      font-size: 0.9rem;
      font-weight: 550;
      text-decoration: none;
    }
    .settings-menu__link:hover,
    .settings-menu__link:focus-visible {
      background: color-mix(in srgb, var(--fg) 7%, transparent);
      color: var(--fg);
      text-decoration: none;
    }
    .settings-menu__link[aria-current="page"] {
      background: var(--accent-soft);
      color: var(--accent-strong);
    }

    @media (max-width: 768px) {
      .settings-frame {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
      }
      .settings-frame__aside {
        position: static;
      }
      .settings-menu {
        display: flex;
        gap: 0.25rem;
        overflow-x: auto;
        scrollbar-width: none;
      }
      .settings-menu__group {
        display: contents;
      }
      .settings-menu__title {
        display: none;
      }
      .settings-menu__link {
        white-space: nowrap;
      }
      .section__head,
      .section__body,
      .section__foot,
      .list-row {
        padding-inline: 0.9rem;
      }
    }
  }
}
