:root {
  --stw-red: #d51e36;
  --stw-green: #337533;
  --stw-green-light: #489e29;
  --stw-ink: #435151;
  --stw-muted: #6e7b7b;
  --stw-line: #d1d2d4;
  --stw-soft: #f3f4f3;
  --stw-row: #eeeeee;
  --stw-white: #ffffff;
  --shadow: 0 1px 4px rgba(67, 81, 81, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--stw-soft);
  color: var(--stw-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
}

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

a:hover {
  text-decoration: underline;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--stw-soft);
  overflow: hidden;
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  background: var(--stw-white);
  border-top: 3px solid var(--stw-red);
  border-bottom: 1px solid var(--stw-line);
  box-shadow: 0 1px 3px rgba(67, 81, 81, 0.08);
}

.app-brand {
  display: block;
  width: 44px;
  line-height: 0;
}

.app-brand img {
  width: 44px;
  height: auto;
  display: block;
}

.app-title {
  min-width: 0;
}

.app-title__eyebrow,
.panel-kicker {
  color: var(--stw-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-title h1,
.panel-head h2 {
  margin: 0;
  color: var(--stw-ink);
  font-size: 1rem;
  line-height: 1.1;
}

.app-actions {
  display: flex;
  gap: 4px;
}

.app-action,
.button_einstellungen {
  min-height: 34px;
  border: 1px solid var(--stw-green);
  border-radius: 6px;
  background: var(--stw-green);
  color: var(--stw-white);
  padding: 4px 7px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.app-action--quiet {
  border-color: var(--stw-line);
  background: var(--stw-white);
  color: var(--stw-ink);
}

.app-action:hover,
.button_einstellungen:hover {
  background: var(--stw-green-light);
  border-color: var(--stw-green-light);
}

.app-action--quiet:hover {
  background: var(--stw-row);
  border-color: var(--stw-line);
}

.app-view {
  min-height: 0;
}

#content {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.controls {
  display: grid;
  grid-template-columns: minmax(105px, 0.72fr) minmax(0, 1.28fr);
  gap: 6px;
  align-items: end;
  padding: 6px 7px;
  background: var(--stw-white);
  border-bottom: 1px solid var(--stw-line);
}

.field {
  display: grid;
  gap: 2px;
}

.field label {
  color: var(--stw-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.field select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--stw-line);
  border-radius: 6px;
  background: var(--stw-white);
  color: var(--stw-ink);
  padding: 4px 7px;
  outline: none;
}

.field select:focus {
  border-color: var(--stw-red);
  box-shadow: 0 0 0 2px rgba(213, 30, 54, 0.12);
}

.day-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(36px, 0.58fr);
  gap: 4px;
  align-items: center;
}

.day-tabs button,
.more-link {
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--stw-line);
  border-radius: 6px;
  background: var(--stw-white);
  color: var(--stw-ink);
  padding: 4px 5px;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
}

.day-tabs button:hover,
.more-link:hover {
  background: var(--stw-row);
  text-decoration: none;
}

.day-tabs .tag_selektiert {
  border-color: var(--stw-ink);
  background: var(--stw-ink);
  color: var(--stw-white);
}

#gerichte {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 7px;
}

.meal-list-inner {
  display: grid;
  gap: 5px;
}

.meal-card {
  overflow: hidden;
  border: 1px solid var(--stw-line);
  border-left: 3px solid var(--stw-red);
  border-radius: 6px;
  background: var(--stw-white);
  box-shadow: var(--shadow);
}

.meal-card__head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: flex-start;
  padding: 6px 8px 0;
}

.meal-card__category {
  color: var(--stw-red);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.meal-card__price {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--stw-green);
  color: var(--stw-white);
  padding: 2px 7px;
  font-size: 0.78rem;
  font-weight: 700;
}

.meal-card__title {
  margin: 3px 8px 0;
  color: var(--stw-ink);
  font-size: 0.92rem;
  line-height: 1.2;
}

.meal-card__description {
  margin: 3px 8px 0;
  color: #243232;
  font-size: 0.84rem;
  line-height: 1.24;
}

.meal-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
  padding: 5px 8px;
  background: #fafafa;
  border-top: 1px solid #e6e7e7;
}

.meal-card__price-text {
  color: var(--stw-muted);
  font-size: 0.72rem;
  font-style: italic;
}

.meal-card__icons {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
}

.meal-card__icons img,
.legend-item img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.meldung {
  border: 1px solid var(--stw-line);
  border-left: 4px solid var(--stw-red);
  border-radius: 6px;
  background: var(--stw-white);
  color: var(--stw-ink);
  font-weight: 700;
  margin: 12px 0;
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

#content_einstellungen,
#content_info {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 7px;
}

.panel-view {
  background: var(--stw-soft);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.option-group {
  margin: 0 0 7px;
  padding: 8px;
  border: 1px solid var(--stw-line);
  border-radius: 6px;
  background: var(--stw-white);
  box-shadow: var(--shadow);
}

.option-group legend {
  color: var(--stw-ink);
  font-weight: 700;
  padding: 0 4px;
}

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

.segmented label,
.checkbox-grid label {
  cursor: pointer;
}

.segmented input,
.checkbox-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span,
.checkbox-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--stw-line);
  border-radius: 6px;
  background: var(--stw-white);
  color: var(--stw-ink);
  padding: 4px 5px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.segmented input:checked + span,
.checkbox-grid input:checked + span {
  border-color: var(--stw-green);
  background: var(--stw-green);
  color: var(--stw-white);
}

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

.checkbox-grid span {
  justify-content: flex-start;
  text-align: left;
  font-size: 0.78rem;
}

.panel-actions {
  margin-top: auto;
  padding-top: 4px;
  text-align: right;
}

.legend-grid {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--stw-line);
  border-radius: 6px;
  background: var(--stw-white);
  padding: 6px 8px;
  box-shadow: var(--shadow);
}

.legend-item span {
  font-weight: 700;
}

.info_titel {
  color: var(--stw-red);
  font-weight: 700;
  margin: 12px 0 6px;
}

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

@media (max-width: 360px) {
  .app-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .app-brand,
  .app-brand img {
    width: 36px;
  }

  .app-title__eyebrow {
    display: none;
  }

  .app-title h1 {
    font-size: 0.92rem;
  }

  .app-action,
  .button_einstellungen {
    min-height: 28px;
    padding: 3px 6px;
    font-size: 0.76rem;
  }
}

@media (max-width: 320px) {
  .controls {
    grid-template-columns: 1fr;
  }
}
