:root {
  color-scheme: light;
  --ink: #24313d;
  --muted: #697782;
  --line: #dfe7e4;
  --paper: #fbf7ef;
  --surface: #ffffff;
  --green: #23856d;
  --blue: #3f7ea6;
  --coral: #e97862;
  --sun: #f0bc4b;
  --shadow: 0 14px 34px rgba(28, 38, 48, .13);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: linear-gradient(180deg, #fffaf1 0%, #f2faf5 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 14px calc(88px + env(safe-area-inset-bottom));
}

.screen {
  display: none;
  max-width: 520px;
  margin: 0 auto;
  animation: screen-in .24s ease both;
}

.screen.active {
  display: block;
}

.home-panel,
.placeholder-panel {
  min-height: calc(100dvh - 116px);
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
}

.home-mark,
.placeholder-panel span {
  font-size: 48px;
}

.home-panel h1,
.placeholder-panel h2,
.screen-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.home-panel h1 {
  font-size: 34px;
}

.home-panel p,
.placeholder-panel p {
  width: min(300px, 86vw);
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}

.home-portal-link {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  margin: 6px auto 0;
  padding: 0 16px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.home-portal-link.secondary {
  color: var(--green);
  background: #e8f6ee;
}

.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.portal-home {
  min-height: calc(100dvh - 116px);
  display: grid;
  gap: 14px;
  align-content: center;
}

.portal-login-card,
.portal-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 20px rgba(28, 38, 48, .08);
}

.portal-login-card {
  display: grid;
  gap: 13px;
  min-height: 348px;
  align-content: center;
  padding: 18px;
}

.portal-login-card p {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.portal-login-card h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.portal-login-card form {
  display: grid;
  gap: 8px;
}

.portal-login-form.is-idle .portal-field,
.portal-login-form.is-idle #portal-submit {
  visibility: hidden;
  pointer-events: none;
}

.portal-field {
  display: grid;
  gap: 6px;
}

.portal-field[hidden] {
  display: none;
}

.portal-login-card label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.portal-login-card input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
}

.portal-login-card button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 900;
}

.portal-login-card button:disabled {
  opacity: .65;
}

#portal-message {
  display: block;
  min-height: 19px;
  color: #38504a;
  font-size: 13px;
  line-height: 1.45;
}

#portal-message.is-empty {
  visibility: hidden;
}

#portal-message.error {
  color: #8d3027;
}

.portal-options {
  display: grid;
  gap: 10px;
}

.portal-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

.portal-option span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: #e8f6ee;
  font-size: 27px;
}

.portal-option strong {
  font-size: 24px;
  line-height: 1.18;
}

.portal-option small {
  display: none;
}

.portal-option.active {
  border-color: rgba(35, 133, 109, .6);
  background: #f3fbf6;
}

.portal-option:active {
  transform: scale(.98);
}

.screen-head {
  padding: 8px 2px 16px;
}

.screen-head p,
.admin-head p {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.screen-head h2 {
  font-size: 25px;
}

.gallery-grid {
  display: grid;
  gap: 20px;
}

.gallery-category {
  display: grid;
  gap: 10px;
}

.gallery-category h3 {
  margin: 4px 2px 2px;
  color: #26333d;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: 0;
}

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

.gallery-card {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  color: inherit;
  text-align: left;
  box-shadow: 0 8px 20px rgba(28, 38, 48, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.gallery-card:active {
  transform: scale(.97);
  box-shadow: 0 5px 14px rgba(28, 38, 48, .08);
}

.thumb {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6dbb9a, #f0bc4b);
  background-size: cover;
  background-position: center;
  color: rgba(255, 255, 255, .92);
  font-size: 34px;
}

.gallery-card strong {
  display: block;
  min-height: 44px;
  padding: 9px 10px 10px;
  font-size: 15px;
  line-height: 1.28;
}

.empty {
  padding: 22px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  text-align: center;
}

.screen[data-screen="fee"] {
  padding-bottom: 230px;
}

.fee-calculator {
  display: grid;
  gap: 14px;
}

.fee-section {
  display: grid;
  gap: 8px;
}

.fee-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.project-grid {
  grid-template-columns: 1fr;
  position: relative;
}

.choice-button {
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  text-align: center;
  font-weight: 800;
  box-shadow: 0 7px 16px rgba(28, 38, 48, .06);
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease;
}

.choice-button:active {
  transform: scale(.97);
}

.choice-button.active {
  border-color: rgba(35, 133, 109, .58);
  background: #e8f6ee;
  color: var(--green);
}

.project-select {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
  box-shadow: 0 7px 16px rgba(28, 38, 48, .06);
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

.project-select:active {
  transform: scale(.98);
}

.project-select.active,
.project-select.has-value {
  border-color: rgba(35, 133, 109, .58);
  color: var(--green);
}

.project-select b {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.project-menu {
  display: none;
  gap: 8px;
  padding-top: 8px;
}

.project-menu.open {
  display: grid;
  animation: screen-in .16s ease both;
}

.project-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  text-align: left;
}

.project-choice strong,
.project-choice span {
  min-width: 0;
}

.project-choice span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.fee-result {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 9;
  width: min(calc(100vw - 28px), 520px);
  display: grid;
  gap: 13px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.fee-result[hidden] {
  display: none;
}

.fee-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.fee-result-head span {
  color: var(--green);
  font-weight: 800;
}

.fee-line {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: baseline;
}

.fee-line > span {
  color: #3d4b55;
  font-size: 15px;
  font-weight: 800;
}

.fee-line strong {
  color: #d92222;
  font-size: 18px;
  line-height: 1;
}

.fee-line strong b {
  font-size: 31px;
  letter-spacing: 0;
}

.fee-line del {
  color: #9aa4ac;
  font-size: 11px;
}

.fee-line em {
  position: absolute;
  top: -14px;
  right: 0;
  min-width: 46px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #d92222;
  color: #ffffff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.fee-hint {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.adjustment-section:empty {
  display: none;
}

.adjustment-list {
  display: grid;
  gap: 13px;
}

.adjustment-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 6px 14px rgba(28, 38, 48, .04);
}

.adjustment-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  align-items: center;
}

.adjustment-options {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.adjustment-group.stacked .adjustment-options {
  display: grid;
  grid-template-columns: 1fr;
}

.adjustment-option {
  width: auto;
  min-width: 0;
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 6px 14px rgba(28, 38, 48, .05);
}

.adjustment-group.stacked .adjustment-option {
  width: max-content;
  max-width: 100%;
}

.adjustment-option.selected {
  border-color: rgba(35, 133, 109, .58);
  background: #f3fbf6;
  color: var(--green);
}

.adjustment-option strong {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
}

.round-check {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid #68706d;
  border-radius: 50%;
}

.adjustment-option.selected .round-check::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4fc0ad;
}

.adjustment-amount {
  justify-self: end;
  width: 92px;
  color: #858585;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.empty-amount {
  min-width: 92px;
}

.adjustment-note {
  color: #858585;
  font-size: 13px;
  line-height: 1.35;
}

.referral-group .adjustment-line {
  grid-template-columns: minmax(0, 1fr) minmax(108px, auto);
}

.referral-group .adjustment-amount {
  width: auto;
  max-width: 150px;
  white-space: normal;
}

.referral-count-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(28, 38, 48, .05);
}

.referral-count-control strong,
.referral-count-control span {
  font-size: 15px;
  font-weight: 800;
}

.referral-count-control input {
  width: 48px;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.bottom-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(223, 231, 228, .92);
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 -8px 24px rgba(28, 38, 48, .08);
  backdrop-filter: blur(12px);
  overflow: visible;
}

.visitor-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.user-tabs {
  grid-template-columns: repeat(2, 1fr);
}

.admin-tabs {
  grid-template-columns: repeat(5, 1fr);
}

.bottom-tabs button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transform: translateY(0);
  transition: transform .18s ease, background-color .18s ease, color .18s ease;
}

.bottom-tabs button.active {
  color: var(--green);
  background: #e8f6ee;
  transform: translateY(-2px);
}

.bottom-tabs button:active {
  transform: scale(.94);
}

.bottom-tabs span {
  font-size: 23px;
  line-height: 1;
}

.bottom-tabs b {
  font-size: 12px;
}

.user-menu-shell,
.menu-admin-panel {
  display: grid;
  gap: 14px;
}

.menu-admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 2px;
}

.menu-admin-head p,
.menu-meta-line {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.menu-admin-head h2 {
  margin: 2px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

#admin-menu-updated {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.user-subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
}

.user-subtabs button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.user-subtabs button.active {
  color: var(--green);
  background: #e8f6ee;
}

.menu-view[data-menu-panel] {
  display: none;
}

.menu-view[data-menu-panel].active {
  display: grid;
}

.menu-view {
  gap: 12px;
}

.menu-notice {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid var(--coral);
  border-radius: 8px;
  background: rgba(255, 255, 255, .8);
  color: #5d4a35;
  font-size: 13px;
  line-height: 1.55;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px;
  align-items: start;
}

.day-card {
  overflow: hidden;
  border: 1px solid rgba(217, 226, 223, .95);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 22px rgba(40, 49, 59, .07);
}

.day-card > header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 15px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.day-card:nth-child(2n) > header {
  background: linear-gradient(135deg, var(--coral), #d95d39);
}

.day-card:nth-child(3n) > header {
  background: linear-gradient(135deg, #6a8f3f, var(--green));
}

.day-card header span {
  font-size: 21px;
  font-weight: 900;
}

.day-card header small {
  font-size: 13px;
  opacity: .9;
}

.day-note {
  margin: 12px 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.meal {
  padding: 13px;
}

.meal + .meal {
  border-top: 1px dashed var(--line);
}

.meal h3 {
  margin: 0 0 10px;
  color: #33424c;
  font-size: 16px;
}

.dish-list {
  display: grid;
  gap: 9px;
}

.dish-card {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid #e6ece9;
  border-radius: 8px;
  background: #fffdf8;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.dish-card:hover,
.dish-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(35, 133, 109, .45);
  box-shadow: 0 8px 18px rgba(40, 49, 59, .1);
  outline: none;
}

.dish-thumb {
  width: 64px;
  min-height: 64px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background-size: cover;
  background-position: center;
  color: rgba(255, 255, 255, .94);
  font-size: 20px;
  font-weight: 900;
}

.dish-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dish-main strong {
  line-height: 1.25;
}

.dish-main small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.week-calendar-wrap {
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.week-calendar {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 54px repeat(5, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(35, 133, 109, .16);
  border-radius: 8px;
  background: #f3fbf6;
}

.calendar-corner,
.calendar-day-head,
.calendar-category,
.calendar-cell {
  background: rgba(255, 255, 255, .96);
}

.calendar-corner {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-right: 1px solid rgba(255, 255, 255, .8);
  border-bottom: 1px solid rgba(255, 255, 255, .8);
  color: #ffffff;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.calendar-day-head {
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, .8);
  border-right: 1px solid rgba(255, 255, 255, .5);
  color: #ffffff;
  background: var(--green);
}

.calendar-day-head strong {
  font-size: 14px;
  line-height: 1.1;
}

.calendar-day-head span {
  min-height: 16px;
  font-size: 10px;
  opacity: .9;
}

.calendar-category {
  display: grid;
  place-items: center;
  padding: 8px 4px;
  border-right: 1px solid rgba(35, 133, 109, .14);
  border-bottom: 2px solid #ffffff;
  color: #ffffff;
  background: rgba(35, 133, 109, .78);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.calendar-cell {
  min-height: 0;
  aspect-ratio: 1;
  display: grid;
  padding: 1.5px;
  background: #f3fbf6;
}

.calendar-dish {
  position: relative;
  min-width: 0;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 23%;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
}

.calendar-dish-image {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0;
  background-size: cover;
  background-position: center;
  color: rgba(255, 255, 255, .94);
  font-size: 13px;
  font-weight: 900;
}

.calendar-dish strong,
.calendar-dish b {
  min-width: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .82);
  color: inherit;
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-dish-empty {
  background: transparent;
  color: var(--muted);
  cursor: default;
}

.calendar-dish-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(36, 49, 61, .72);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

button.calendar-dish-empty {
  cursor: pointer;
}

.calendar-dish-empty span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: rgba(255, 255, 255, .42);
  font-size: 14px;
  font-weight: 900;
}

.admin-tab-group {
  position: relative;
  display: grid;
}

.admin-home-return {
  display: none;
}

.admin-tab-group > button {
  width: 100%;
  height: 100%;
}

.admin-subtabs {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: grid;
  grid-template-columns: max-content;
  gap: 6px;
  width: max-content;
  padding: 6px;
  border: 1px solid rgba(223, 231, 228, .95);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(28, 38, 48, .14);
  transform: translateX(-50%);
}

.admin-subtabs[hidden] {
  display: none;
}

.admin-tabs .admin-subtabs button {
  width: max-content;
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transform: none;
}

.admin-tabs .admin-subtabs button.active {
  color: var(--green);
  background: #e8f6ee;
  transform: none;
}

.viewer[hidden] {
  display: none;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: max(72px, calc(env(safe-area-inset-top) + 62px)) 14px calc(22px + env(safe-area-inset-bottom));
  overflow: auto;
  background: rgba(24, 31, 36, .52);
  opacity: 1;
  transition: opacity .2s ease;
  animation: viewer-fade-in .2s ease both;
}

.viewer.closing {
  opacity: 0;
}

.viewer-card {
  width: min(92vw, 430px);
  max-height: calc(100dvh - max(92px, calc(env(safe-area-inset-top) + 82px)));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 46px rgba(18, 28, 36, .28);
  transform-origin: center top;
  animation: viewer-card-in .24s cubic-bezier(.2, .85, .25, 1.08) both;
}

.viewer.closing .viewer-card {
  animation: viewer-card-out .18s ease both;
}

.viewer-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #172128;
}

.viewer-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateX(0);
  opacity: 1;
}

.viewer-stage img.slide-left {
  animation: image-slide-left .22s ease both;
}

.viewer-stage img.slide-right {
  animation: image-slide-right .22s ease both;
}

.viewer-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 78px;
  background: linear-gradient(135deg, #27866d, #3f7ea6);
}

.viewer-close,
.viewer-arrow {
  position: absolute;
  z-index: 2;
  border: 0;
  color: #ffffff;
  background: rgba(0, 0, 0, .32);
}

.viewer-close {
  top: 10px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 28px;
}

.viewer-arrow {
  top: 50%;
  width: 34px;
  height: 54px;
  transform: translateY(-50%);
  border-radius: 8px;
  font-size: 40px;
}

.viewer-arrow.left {
  left: 8px;
}

.viewer-arrow.right {
  right: 8px;
}

.viewer-count {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, .38);
  font-size: 12px;
}

.viewer-copy {
  flex: 0 1 auto;
  overflow: auto;
  padding: 22px 24px 28px;
}

.viewer-copy h2 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: 0;
}

.viewer-copy p {
  margin: 0;
  color: #4a5863;
  line-height: 1.72;
  white-space: pre-wrap;
}

.admin-body {
  background: #f6faf8;
}

.admin-body.login-locked {
  overflow: hidden;
}

.admin-login-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow: auto;
  background: #f6faf8;
}

.admin-login-shell[hidden] {
  display: none;
}

.admin-login-card {
  width: min(100%, 360px);
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(28, 38, 48, .12);
}

.admin-login-card p {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.admin-login-card .admin-login-note {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.admin-login-card h1 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: 0;
}

.admin-login-card form {
  display: grid;
  gap: 10px;
}

.admin-login-card input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
  font-size: 18px;
}

.admin-login-card button,
.admin-login-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.login-error {
  color: #8d3027;
  font-size: 14px;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes viewer-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes viewer-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes viewer-card-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(16px) scale(.96);
  }
}

@keyframes image-slide-left {
  from {
    opacity: .6;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes image-slide-right {
  from {
    opacity: .6;
    transform: translateX(-34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

.admin-shell {
  max-width: 540px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 12px calc(92px + env(safe-area-inset-bottom));
}

.admin-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 12px;
  background: #f6faf8;
}

.admin-head h1 {
  margin: 0;
  font-size: 25px;
}

.admin-head button,
.add-card,
.upload-button,
.delete-card {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.admin-head button,
.add-card,
.upload-button {
  color: #ffffff;
  background: var(--green);
}

.admin-link-box,
.status,
.teacher-placeholder-panel,
.category-editor,
.editor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(28, 38, 48, .06);
}

.admin-link-box {
  display: grid;
  gap: 7px;
  padding: 12px;
  margin-bottom: 10px;
}

.admin-link-box label {
  color: var(--muted);
  font-size: 13px;
}

.admin-link-box input,
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
}

.admin-link-box input {
  min-height: 40px;
  padding: 8px 10px;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.teacher-placeholder-panel {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.teacher-placeholder-panel p,
.teacher-placeholder-panel span {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.teacher-placeholder-panel h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.teacher-account-panel {
  display: grid;
  gap: 12px;
}

.account-subpanel {
  display: none;
}

.account-subpanel.active {
  display: grid;
}

.current-teacher-card,
.teacher-list-panel,
.teacher-modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(28, 38, 48, .06);
}

.current-teacher-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.current-teacher-card p,
.teacher-list-panel p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.current-teacher-card h2,
.teacher-list-panel h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.current-teacher-card button,
.teacher-list-panel header button,
.teacher-row-actions button,
.teacher-modal-submit {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 900;
}

.teacher-list-panel {
  padding: 14px;
}

.teacher-list-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.teacher-list {
  display: grid;
  gap: 8px;
}

.teacher-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.teacher-row-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.teacher-row-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--green);
  background: #e8f6ee;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.teacher-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.teacher-row-actions button {
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
}

.teacher-row-actions button[disabled] {
  color: var(--muted);
  background: #edf2ef;
}

.current-teacher-card button[disabled],
.teacher-list-panel header button[disabled],
.add-card[disabled],
.delete-card[disabled] {
  color: var(--muted);
  background: #edf2ef;
  cursor: not-allowed;
}

.teacher-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 32, 28, .36);
}

.teacher-modal[hidden] {
  display: none;
}

.teacher-modal-card {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  gap: 10px;
  padding: 18px;
}

.teacher-modal-card .field[hidden] {
  display: none;
}

.teacher-modal-card h2 {
  margin: 0 36px 4px 0;
  font-size: 22px;
  letter-spacing: 0;
}

.menu-dish-editor {
  width: min(460px, 100%);
}

.menu-dish-editor-image {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  color: rgba(255, 255, 255, .95);
  font-size: 24px;
  font-weight: 900;
}

.menu-dish-editor-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-dish-card {
  width: min(430px, 100%);
}

.user-dish-card .dish-context {
  margin: 2px 0 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.user-dish-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.teacher-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #edf2ef;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.status {
  display: none;
  margin-bottom: 10px;
  padding: 10px 12px;
  color: #38504a;
  font-size: 14px;
}

.status.show {
  display: block;
}

.editor-list {
  display: grid;
  gap: 14px;
}

.category-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fdfefa;
}

.category-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.category-name {
  margin: 0;
}

.category-card-list {
  display: grid;
  gap: 10px;
}

.admin-card-grid {
  min-height: 86px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-radius: 8px;
  outline: 1px dashed rgba(35, 133, 109, .18);
  outline-offset: 4px;
}

.admin-gallery-card {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.admin-gallery-card.dragging {
  position: relative;
  z-index: 40;
  opacity: .9;
  box-shadow: 0 18px 40px rgba(28, 38, 48, .24);
  transition: none;
  pointer-events: none;
}

.drag-active {
  overflow: hidden;
  user-select: none;
}

.editor-card {
  padding: 12px;
  box-shadow: none;
}

.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.editor-top strong {
  font-size: 16px;
}

.delete-card {
  padding: 0 12px;
  color: #8d3027;
  background: #ffe7e2;
}

.field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field textarea {
  padding: 10px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.image-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.image-chip {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #6dbb9a, #f0bc4b);
}

.image-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-chip button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(0, 0, 0, .5);
}

.upload-button,
.add-card {
  width: 100%;
}

.upload-button {
  display: grid;
  place-items: center;
  margin-top: 8px;
}

.upload-button input {
  display: none;
}

.add-card {
  margin-top: 14px;
}

.add-card.secondary {
  color: var(--green);
  background: #e8f6ee;
}

.add-card-inline {
  margin-top: 0;
  min-height: 40px;
  color: var(--green);
  background: #e8f6ee;
}

.pricing-editor-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(28, 38, 48, .06);
}

.pricing-editor-head .field {
  margin: 0;
}

.pricing-editor-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pricing-editor-list {
  display: grid;
  gap: 14px;
}

.pricing-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdfefa;
  box-shadow: 0 8px 20px rgba(28, 38, 48, .06);
}

.pricing-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pricing-title-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pricing-group-title h2,
.pricing-group-title h3 {
  margin: 0;
}

.pricing-group-title h2 {
  font-size: 24px;
}

.pricing-group-title span {
  color: var(--muted);
  font-size: 12px;
}

.pricing-fold-button {
  flex: 0 0 auto;
  min-width: 42px;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.pricing-panel-body {
  display: grid;
  gap: 10px;
}

.pricing-group.collapsed,
.adjustment-editor-group.collapsed {
  gap: 0;
}

.pricing-group.collapsed > .pricing-panel-body,
.adjustment-editor-group.collapsed > .pricing-panel-body {
  display: none;
}

.pricing-table {
  display: grid;
  gap: 7px;
}

.pricing-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) auto;
  gap: 7px;
  align-items: center;
}

.pricing-row-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pricing-row input {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--ink);
}

.pricing-delete {
  min-height: 38px;
  padding: 0 9px;
  font-size: 13px;
}

.pricing-adjustments {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.pricing-adjustments > h2 {
  margin: 0;
  font-size: 24px;
}

.pricing-adjustments > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.adjustment-editor-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(28, 38, 48, .06);
}

.adjustment-editor-group h3 {
  margin: 0;
  font-size: 19px;
}

.adjustment-editor-list {
  display: grid;
  gap: 10px;
}

.adjustment-editor-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.adjustment-editor-row input,
.adjustment-editor-row textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.adjustment-editor-row input {
  min-height: 38px;
  padding: 8px;
}

.adjustment-editor-row [data-field="adjustment-price"] {
  grid-column: 1 / -1;
}

.limit-picker {
  position: relative;
  z-index: 5;
  grid-column: 1 / -1;
}

.limit-picker:focus-within {
  z-index: 70;
}

.limit-picker-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.limit-picker-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.limit-picker-button b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limit-picker-button i {
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.limit-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 90;
  display: grid;
  gap: 8px;
  max-height: min(58vh, 360px);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(105, 119, 130, .3);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(28, 38, 48, .18);
}

.limit-picker-popover[hidden] {
  display: none;
}

.limit-picker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.limit-picker-top.compact {
  margin-top: 2px;
}

.limit-picker-top strong {
  font-size: 12px;
}

.limit-picker-top button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  color: var(--green);
  background: #e8f6ee;
  font-weight: 800;
}

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

.limit-choice {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 30px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.adjustment-editor-row .limit-choice input {
  flex: 0 0 auto;
  width: 14px;
  min-height: 14px;
  padding: 0;
}

.limit-choice span {
  min-width: 0;
}

.limit-choice:has(input:checked) {
  border-color: rgba(31, 139, 76, .45);
  background: #e8f6ee;
  color: var(--green);
}

.adjustment-editor-row textarea {
  grid-column: 1 / -1;
  min-height: 58px;
  padding: 8px;
  resize: vertical;
}

.tier-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px dashed rgba(105, 119, 130, .35);
  border-radius: 8px;
  background: #ffffff;
}

.tier-editor label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.adjustment-editor-row .pricing-delete {
  grid-column: 1 / -1;
}

.adjustment-editor-row input:disabled,
.adjustment-editor-row button:disabled {
  opacity: .55;
}

.admin-editor-modal {
  z-index: 50;
}

.admin-edit-card {
  width: min(92vw, 430px);
}

.admin-edit-copy {
  display: grid;
  gap: 8px;
  padding: 18px 18px 22px;
}

.admin-edit-copy .field {
  margin: 0;
}

.admin-edit-copy textarea {
  min-height: 108px;
}

.delete-card-wide {
  width: 100%;
  margin-top: 4px;
}

@media (min-width: 720px) {
  .app-shell {
    padding: 34px 32px 112px;
  }

  .screen {
    max-width: 1080px;
  }

  .screen[data-screen="home"] {
    max-width: 960px;
  }

  .home-panel,
  .placeholder-panel {
    min-height: calc(100vh - 164px);
  }

  .portal-home {
    min-height: calc(100vh - 164px);
    grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr);
    align-items: center;
    gap: 24px;
  }

  .portal-login-card {
    min-height: 360px;
    align-content: center;
    padding: 28px;
  }

  .portal-login-card h1 {
    font-size: 40px;
  }

  .portal-options {
    gap: 14px;
  }

  .portal-option {
    min-height: 104px;
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 18px;
  }

  .portal-option span {
    width: 58px;
    height: 58px;
    font-size: 31px;
  }

  .portal-option strong {
    font-size: 30px;
  }

  .home-panel h1 {
    font-size: 46px;
  }

  .home-panel p,
  .placeholder-panel p {
    width: min(560px, 72vw);
    font-size: 17px;
  }

  .screen-head {
    padding: 8px 0 22px;
  }

  .screen-head h2 {
    font-size: 34px;
  }

  .gallery-grid {
    gap: 30px;
  }

  .gallery-category {
    gap: 14px;
  }

  .gallery-category h3 {
    font-size: 30px;
  }

  .gallery-grid-inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .gallery-card:hover {
    border-color: rgba(35, 133, 109, .42);
    box-shadow: 0 14px 28px rgba(28, 38, 48, .1);
    transform: translateY(-2px);
  }

  .screen[data-screen="fee"] {
    max-width: 920px;
    padding-bottom: 230px;
  }

  .fee-calculator {
    gap: 18px;
  }

  .choice-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .project-grid,
  .adjustment-section .choice-grid {
    grid-template-columns: 1fr;
  }

  .fee-result {
    bottom: 92px;
    width: min(720px, calc(100vw - 64px));
  }

  .bottom-tabs {
    left: 50%;
    right: auto;
    bottom: 18px;
    width: min(520px, calc(100vw - 64px));
    padding: 8px;
    border: 1px solid rgba(223, 231, 228, .92);
    border-radius: 18px;
    transform: translateX(-50%);
  }

  .bottom-tabs button {
    min-height: 48px;
  }

  .viewer {
    align-items: center;
    padding: 38px;
  }

  .viewer-card {
    width: min(920px, calc(100vw - 76px));
    max-height: calc(100vh - 76px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .viewer-stage {
    min-height: 0;
  }

  .viewer-copy {
    min-height: 0;
  }

  .admin-login-card {
    width: min(420px, 100%);
    padding: 28px;
  }

  .admin-shell {
    max-width: 860px;
    padding: 28px 28px 108px;
  }

  .admin-head {
    padding: 14px 0 18px;
  }

  .admin-link-box {
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: center;
  }

  .admin-link-box label {
    font-weight: 800;
  }

  .admin-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .pricing-row {
    grid-template-columns: minmax(0, 1fr) 220px 88px;
  }

  .adjustment-editor-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .limit-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-edit-card {
    width: min(920px, calc(100vw - 76px));
  }

  .admin-edit-copy {
    min-height: 0;
  }
}

@media (min-width: 960px) {
  .admin-shell {
    max-width: 1240px;
    padding: 28px 36px 44px 218px;
  }

  .admin-tabs.bottom-tabs {
    top: 118px;
    right: auto;
    bottom: auto;
    left: 28px;
    width: 158px;
    grid-template-columns: 1fr;
    padding: 8px;
    border: 1px solid rgba(223, 231, 228, .92);
    border-radius: 14px;
    transform: none;
  }

  .admin-home-return {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--green);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
  }

  .admin-subtabs {
    left: calc(100% + 8px);
    right: auto;
    top: 50%;
    bottom: auto;
    grid-template-columns: max-content;
    transform: translateY(-50%);
  }

  .admin-tabs.bottom-tabs button {
    min-height: 48px;
    grid-template-columns: 26px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    padding: 0 12px;
  }

  .admin-tabs.bottom-tabs span {
    font-size: 20px;
  }

  .admin-tabs.bottom-tabs b {
    font-size: 13px;
  }

  .admin-tabs.bottom-tabs .admin-subtabs button {
    width: max-content;
    min-height: 32px;
    display: inline-flex;
    grid-template-columns: none;
    justify-content: center;
    justify-items: center;
    padding: 6px 12px;
  }

  .admin-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pricing-editor-list {
    gap: 16px;
  }

  .pricing-group,
  .adjustment-editor-group,
  .pricing-editor-head,
  .category-editor {
    padding: 16px;
  }
}

@media (min-width: 1220px) {
  .gallery-grid-inner {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .admin-card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
