:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #213333;
  background: #f1f4f2;
  --ink: #213333;
  --muted: #536765;
  --line: #d5dfdb;
  --teal: #154b49;
  --accent: #a63125;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
:focus-visible { outline: 3px solid #2a7570; outline-offset: 3px; }
.container { width: min(1160px, calc(100% - 2.5rem)); margin: 0 auto; }
.masthead {
  position: relative;
  overflow: hidden;
  color: #fffaf1;
  background: linear-gradient(105deg, #143a3b, #17524e);
  border-bottom: 4px solid #b03628;
}
.masthead::after {
  content: "";
  position: absolute;
  inset: -5rem -6rem 0 auto;
  width: min(55vw, 520px);
  transform: skewX(-25deg);
  opacity: .25;
  background: repeating-linear-gradient(to bottom, transparent 0 1.25rem, #6aa69d 1.25rem 1.32rem);
  pointer-events: none;
}
.masthead-inner { position: relative; z-index: 1; padding: 2.4rem 0 2.75rem; }
.eyebrow { font-size: .85rem; letter-spacing: .2em; color: #cbe3d9; }
h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); line-height: 1.2; letter-spacing: .045em; margin: .25rem 0 .65rem; }
.masthead-inner > p:last-child { color: #e4efe8; }
main.container { margin-top: 1.5rem; padding-bottom: 2.75rem; }
.acknowledgments { padding-bottom: 1.5rem; color: #6b7074; font-size: .875rem; text-align: center; }
.workspace { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; gap: 1rem; }
.panel { min-width: 0; padding: 1.3rem; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 12px #143c3310; }
h2 { margin-bottom: .7rem; font-size: 1.18rem; line-height: 1.35; }
label { display: grid; gap: .3rem; color: var(--ink); font-size: .9rem; font-weight: 600; }
input, select {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 2.55rem;
  padding: .42rem .55rem;
  border: 1px solid #adbeb7;
  border-radius: 6px;
  color: var(--ink);
  background-color: white;
  font-size: 1rem;
  font-weight: 400;
}
input::placeholder { color: #647573; }
select { appearance: none; padding-right: 1.55rem; background-image: linear-gradient(45deg, transparent 48%, #526c66 51%), linear-gradient(135deg, #526c66 49%, transparent 52%); background-size: .31rem .31rem; background-position: right .83rem center, right .52rem center; background-repeat: no-repeat; }
.stage-fields { display: grid; gap: .65rem .85rem; grid-template-columns: repeat(2, minmax(0, 10rem)); align-items: end; margin-bottom: 1.15rem; }
.stage-fields > p { grid-column: 1 / -1; }
.stage-preset { grid-column: 1 / -1; }
.dish-list { display: grid; gap: .8rem; margin-bottom: .9rem; }
.dish { min-width: 0; margin: 0; padding: .65rem .75rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: #fafbf9; }
.dish legend { color: var(--teal); font-size: .92rem; font-weight: 700; padding: 0 .25rem; }
.dish-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6rem, 9rem) auto; gap: .45rem; align-items: end; }
.dish-info:not(:empty) { margin-top: .5rem; }
.secondary, .primary, .remove, .file-button { border-radius: 6px; min-height: 2.55rem; font-size: .94rem; font-weight: 650; }
.secondary { padding: .4rem .75rem; background: #edf5f0; color: var(--teal); border: 1px solid #b0c6bc; }
.secondary:hover:not(:disabled) { background: #deede4; }
.primary { padding: .45rem 1.1rem; border: 1px solid #8b2b21; background: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: #8b291f; }
.remove { width: 2rem; border: 1px solid var(--line); background: white; color: var(--accent); font-size: 1.3rem; padding: 0; }
.remove:hover { background: #fcf0ed; }
.file-button { padding: .25rem 0; border: 0; background: none; color: var(--teal); text-decoration: underline; text-underline-offset: .18em; }
.muted { color: var(--muted); font-size: .91rem; }
.account form { margin-top: .8rem; }
.import-line { display: flex; gap: .4rem; margin-top: .3rem; }
.import-line button { flex-shrink: 0; }
.status { margin: .55rem 0 .4rem; padding: .55rem .65rem; background: #edf5f0; border-left: 3px solid #3c847a; border-radius: 3px; overflow-wrap: anywhere; }
.error { color: #8e2b22; }
.status.error { background: #fcf0ed; border-left-color: var(--accent); }
.account details { margin-top: .8rem; }
.check-row { display: flex; align-items: center; gap: .45rem; margin-top: .8rem; }
.check-row input { flex: none; width: 1.1rem; min-height: 0; height: 1.1rem; margin: 0; accent-color: var(--teal); }
.dish-specialization { margin-top: .45rem; }
.check-row + .muted { margin-top: .35rem; }
.equipment-source { margin-top: .55rem; }
.equipment-source + .muted { margin-top: .35rem; }
.equipment-fields { display: grid; gap: .55rem; }
.picker-field { display: grid; gap: .3rem; min-width: 0; }
.picker-field > span { font-size: .9rem; font-weight: 600; }
.picker { position: relative; min-width: 0; }
.picker-trigger {
  position: relative;
  display: grid;
  gap: .1rem;
  width: 100%;
  min-height: 2.55rem;
  padding: .4rem 2rem .4rem .55rem;
  border: 1px solid #adbeb7;
  border-radius: 6px;
  color: var(--ink);
  background: white;
  text-align: left;
  overflow-wrap: anywhere;
}
.picker-trigger::after {
  position: absolute;
  top: 50%;
  right: .85rem;
  width: .45rem;
  height: .45rem;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  content: "";
  transform: translateY(-70%) rotate(45deg);
}
.picker-trigger[aria-expanded="true"]::after { transform: translateY(-25%) rotate(225deg); }
.picker-panel {
  position: absolute;
  z-index: 3;
  top: calc(100% + .3rem);
  inset-inline: 0;
  display: grid;
  gap: .35rem;
  padding: .45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 6px 18px #143c3324;
}
.picker-clear {
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--teal);
  background: #f5f9f6;
}
.picker-clear:hover { background: #edf5f0; }
.picker-options { position: relative; max-height: min(17rem, 42vh); overflow-y: auto; }
.picker-option {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .1rem .55rem;
  padding: .45rem .55rem;
  border-radius: 5px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.chef-picker .picker-option, .picker-descriptions { display: grid; gap: .12rem; }
.picker-option:hover, .picker-option.active { background: #edf5f0; }
.picker-option[aria-selected="true"] { color: var(--teal); font-weight: 650; }
.picker-description, .picker-descriptions { color: var(--muted); font-size: .85rem; font-weight: 400; }
.picker-empty { padding: .35rem .55rem; }
.equipment-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; }
#equipment-editor > p:not(:empty) { margin-top: .4rem; }
summary { cursor: pointer; color: var(--teal); font-weight: 650; }
.account ul { max-height: 14rem; overflow: auto; display: grid; grid-template-columns: repeat(2, 1fr); padding: 0 0 0 1.3rem; gap: .15rem .9rem; }
.rules, .actions { margin-top: 1rem; }
.rules > p { margin: .55rem 0 .7rem; }
.rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.section-top { display: flex; align-items: start; justify-content: space-between; gap: .6rem; }
.section-top button { flex-shrink: 0; }
.search-controls { display: flex; align-items: end; gap: .45rem; }
.search-controls select { min-width: 8rem; }
.result-summary { padding: .7rem .85rem; border-left: 3px solid #327568; background: #edf5f0; margin-top: 1rem; }
.result-summary strong { color: var(--teal); font-size: 1.25rem; }
.result-team { display: grid; gap: .75rem; margin: .85rem 0; padding-left: 1.5rem; }
.result-team small { display: block; margin-top: .25rem; color: var(--muted); font-size: .86rem; }
.lineup-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem .75rem; max-width: 48rem; }
.numbers { display: flex; flex-wrap: wrap; gap: .45rem; margin: .8rem 0; }
.numbers span { padding: .3rem .55rem; background: #eef3f0; border-radius: 4px; }
.table-wrap { overflow: auto; margin-top: .75rem; }
table { width: 100%; min-width: 620px; border-collapse: collapse; text-align: left; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
th { background: #f0f5f2; color: var(--teal); font-size: .9rem; }
.result-note { margin-top: .7rem; }
@media (max-width: 840px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .account { grid-row: 1; }
}
@media (max-width: 600px) {
  .container { width: calc(100% - 1.4rem); }
  .masthead-inner { padding: 1.6rem 0 1.85rem; }
  .panel { padding: .85rem; }
  .dish-fields { grid-template-columns: minmax(0, 1fr) minmax(5rem, 7rem) auto; gap: .33rem; }
  .stage-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-top { display: grid; }
  .lineup-fields { grid-template-columns: minmax(0, 1fr); }
}

#selected-chefs-dialog { max-width: 34rem; width: calc(100% - 2rem); }
#selected-chefs-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.selected-chefs-list { max-height: 55vh; overflow: auto; margin: .6rem 0 1rem; padding-right: .4rem; }
.selected-chefs-list p { margin: .25rem 0; }
.roster-quick { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin: .4rem 0 .2rem; }
.roster-quick .check-row { margin: 0; }
.roster-quick input[type="number"] { width: 4.5rem; padding: .15rem .3rem; margin: 0 .2rem; }
.roster-groups { max-height: 20rem; overflow: auto; }
.roster-tier { border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; margin-top: .5rem; }
.roster-tier-head { font-weight: 600; margin-top: 0; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.roster-chef { margin-top: .35rem; font-weight: 400; }
