:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1e1e1e;
  --surface-raised: #252525;
  --surface-light: #2a2a2a;
  --text: #f7f7f7;
  --muted: #b8b8b8;
  --line: #343434;
  --accent: #72d65f;
  --accent-solid: var(--accent);
  --accent-ink: #081108;
  --amount: #f3c75d;
  --water: #4fb8ff;
  --warning: var(--amount);
  --info: var(--water);
  --danger: #ff7b7b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}

main {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: clamp(16px, 5vw, 24px) clamp(12px, 4vw, 16px) 36px;
  overflow-x: hidden;
}

header {
  padding: 0 0 18px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: clamp(10px, 3vw, 14px);
  min-height: clamp(68px, 20vw, 82px);
  border-radius: 8px;
  background: var(--surface);
  padding: 4px 14px 4px 4px;
}

.app-header[data-clickable="true"] {
  cursor: pointer;
}

.app-header[data-clickable="true"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.app-logo {
  flex: 0 0 auto;
  width: clamp(60px, 18vw, 74px);
  height: clamp(60px, 18vw, 74px);
  border-radius: 8px;
  background: transparent;
  object-fit: contain;
  padding: 0;
  box-shadow: none;
}

h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.75rem, 9vw, 2.65rem);
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

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

button {
  cursor: pointer;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100vw - 32px);
  border: 1px solid rgba(114, 214, 95, 0.4);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-tabs {
  display: grid;
  grid-template-columns: 58px repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 14px;
}

.tab-button,
.add-button,
.cart-button,
.form-button {
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
}

.form-button.primary,
.hub-community-button {
  text-shadow: none;
  -webkit-text-stroke: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.tab-button {
  padding: 0 5px;
  overflow: hidden;
  font-size: clamp(0.74rem, 3.25vw, 0.95rem);
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.form-button,
.component-name,
.bait-tile-name,
.bait-list-name,
.card h2,
.recipe-card h2,
.store-card h2 {
  overflow-wrap: anywhere;
}

.tab-button.active {
  border-color: var(--accent);
  background: rgba(114, 214, 95, 0.14);
  color: var(--accent);
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 calc(-1 * clamp(12px, 4vw, 16px)) 16px;
  padding: 10px clamp(12px, 4vw, 16px) 12px;
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(44px, 12vw, 52px) clamp(48px, 14vw, 58px);
  gap: 8px;
  align-items: stretch;
}

.view-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.filter-chip-list,
.tag-filter-list,
.recipe-filter-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 2px 2px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
}

.tag-filter-list {
  margin-top: 8px;
}

.recipe-filter-list {
  margin-top: 10px;
  margin-bottom: 4px;
}

.filter-chip-list::-webkit-scrollbar,
.tag-filter-list::-webkit-scrollbar,
.recipe-filter-list::-webkit-scrollbar {
  display: none;
}

.filter-chip,
.tag-filter-button,
.recipe-filter-button {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.filter-chip.active,
.tag-filter-button.active,
.recipe-filter-button.active {
  border-color: var(--accent);
  background: rgba(114, 214, 95, 0.1);
  color: var(--accent);
}

.view-mode-button {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0;
}

.view-mode-button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(114, 214, 95, 0.1);
}

.mode-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
}

.mode-icon.list {
  background:
    linear-gradient(currentColor 0 0) 8px 5px / 14px 3px no-repeat,
    linear-gradient(currentColor 0 0) 8px 11px / 14px 3px no-repeat,
    linear-gradient(currentColor 0 0) 8px 17px / 14px 3px no-repeat,
    linear-gradient(currentColor 0 0) 2px 5px / 4px 3px no-repeat,
    linear-gradient(currentColor 0 0) 2px 11px / 4px 3px no-repeat,
    linear-gradient(currentColor 0 0) 2px 17px / 4px 3px no-repeat;
}

.mode-icon.grid {
  background:
    linear-gradient(currentColor 0 0) 3px 3px / 7px 7px no-repeat,
    linear-gradient(currentColor 0 0) 14px 3px / 7px 7px no-repeat,
    linear-gradient(currentColor 0 0) 3px 14px / 7px 7px no-repeat,
    linear-gradient(currentColor 0 0) 14px 14px / 7px 7px no-repeat;
}

.search-input,
.field-input,
.field-textarea,
.field-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  outline: none;
}

.search-input {
  min-height: 48px;
  font-size: 1rem;
  padding: 12px clamp(10px, 3vw, 14px);
}

.field-input,
.field-select {
  min-height: 44px;
  padding: 10px 12px;
}

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

.search-input::placeholder,
.field-input::placeholder,
.field-textarea::placeholder {
  color: #888888;
}

.search-input:focus,
.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(114, 214, 95, 0.16);
}

.add-button,
.cart-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--accent);
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  line-height: 1;
}

.cart-button {
  position: relative;
  color: var(--text);
}

.cart-count {
  position: absolute;
  right: 5px;
  top: 4px;
  min-width: 18px;
  border-radius: 999px;
  background: var(--accent-solid);
  color: var(--accent-ink);
  padding: 2px 5px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.form-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.form-panel h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.bait-form {
  display: grid;
  gap: 12px;
}

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

.form-field label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-picker-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #101010;
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.tag-picker-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.store-card .form-actions,
.recipe-card > .form-button {
  margin-bottom: 14px;
}

.recipe-order-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.recipe-order-actions .form-button {
  min-height: 50px;
  font-size: 1rem;
}

.store-card .form-actions {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.form-button.primary {
  border-color: transparent;
  background: var(--accent-solid);
  color: var(--accent-ink);
  font-weight: 800;
}

.form-button.secondary {
  color: var(--muted);
}

.form-button.danger-action {
  border-color: rgba(255, 123, 123, 0.45);
  color: var(--danger);
}

.form-button[hidden] {
  display: none;
}

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

.section-actions {
  display: grid;
  margin: 0 0 14px;
}

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

.recipe-card,
.store-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  padding: clamp(14px, 4vw, 18px);
}

.recipe-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: start;
  gap: 10px;
}

.recipe-card h2,
.store-card h2 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  line-height: 1.2;
}

.recipe-share-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 900;
}

.store-description,
.store-hint {
  margin: 0 0 14px;
  color: var(--muted);
}

.store-description {
  font-size: 0.92rem;
  line-height: 1.45;
}

.hub-panel {
  border: 1px solid rgba(114, 214, 95, 0.28);
  border-radius: 8px;
  background: rgba(114, 214, 95, 0.06);
  padding: 12px;
  margin: 0 0 12px;
}

.hub-panel h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 1rem;
}

.hub-panel .store-description {
  margin: 0;
}

.hub-community {
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 1px solid rgba(114, 214, 95, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(114, 214, 95, 0.18), rgba(100, 181, 246, 0.08)),
    #101010;
  padding: 16px 12px;
  margin: 0 0 14px;
  text-align: center;
}

.hub-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hub-community .store-hint {
  max-width: 28rem;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.hub-community-button {
  width: min(100%, 280px);
  min-height: 58px;
  border-color: transparent;
  background: var(--accent-solid);
  color: var(--accent-ink);
  font-size: clamp(1.05rem, 5vw, 1.35rem);
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: none;
}

.hub-author {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(100, 181, 246, 0.32);
  border-radius: 8px;
  background: rgba(100, 181, 246, 0.08);
  padding: 12px;
  margin: 0 0 12px;
}

.hub-author h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 1.1rem;
}

.hub-author p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.hub-author-links {
  grid-template-columns: repeat(2, 50px);
  gap: 8px;
  margin: 0;
}

.hub-author-links a,
.hub-author-links span {
  width: 50px;
  min-width: 50px;
  min-height: 50px;
  border-color: rgba(255, 255, 255, 0.12);
  background: #080808;
}

.hub-author-links .store-link-icon {
  background: transparent;
}

.hub-actions {
  grid-template-columns: 1fr;
  margin-top: 12px;
  margin-bottom: 10px;
}

.hub-action-hint {
  margin: 0;
  border: 1px solid rgba(114, 214, 95, 0.26);
  border-radius: 8px;
  background: rgba(114, 214, 95, 0.08);
  color: var(--text);
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

.developer-credit {
  margin: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #8a8a8a;
  padding-top: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.developer-credit a {
  color: var(--muted);
  text-decoration: none;
}

.developer-credit a:focus-visible,
.developer-credit a:hover {
  color: var(--accent);
}

.shopping-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
  padding: 0;
  list-style: none;
}

.shopping-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 800;
}

.recipe-shopping-title,
.store-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.store-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, 46px);
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.store-links a,
.store-links span {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
  color: var(--text);
  padding: 0;
  font-weight: 900;
  text-decoration: none;
}

.store-links span[aria-disabled="true"] {
  opacity: 1;
}

.backup-panel,
.update-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(240, 184, 79, 0.35);
  border-radius: 8px;
  background: rgba(240, 184, 79, 0.08);
  padding: 12px;
  margin-top: 16px;
}

.backup-panel h3,
.update-panel h3 {
  margin: 0;
  color: var(--warning);
  font-size: 1rem;
}

.backup-panel p,
.update-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.update-panel {
  border-color: rgba(100, 181, 246, 0.36);
  background: rgba(100, 181, 246, 0.08);
}

.update-panel h3,
.app-version {
  color: var(--info);
}

.app-version {
  font-weight: 900;
}

.store-link-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
}

.store-link-icon img {
  display: block;
  width: 24px;
  height: 24px;
}

.store-link-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.store-contact-title {
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cart-list {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.saved-builder,
.saved-mix-form {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.saved-builder {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 0;
  overflow: hidden;
}

.saved-builder summary {
  min-height: 44px;
  padding: 12px;
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
}

.saved-builder .form-field {
  padding: 0 12px 12px;
}

.saved-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.saved-summary .meta-box {
  min-height: 72px;
}

.meta-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
}

.saved-component-picker {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
  margin-top: 8px;
}

.saved-component-option {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.saved-component-option:disabled {
  opacity: 0.55;
}

.saved-component-option img,
.saved-component-option .cart-item-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #050505;
  object-fit: contain;
}

.saved-component-option-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.saved-component-option-name {
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.saved-component-option-action {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--accent);
  font-weight: 900;
}

.cart-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.empty-state-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid rgba(114, 214, 95, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(114, 214, 95, 0.075), rgba(16, 16, 16, 0.96));
  color: var(--muted);
  padding: clamp(18px, 6vw, 28px) 16px;
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(114, 214, 95, 0.35);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.42);
  font-size: 1.45rem;
  line-height: 1;
}

.empty-state-title {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.2;
}

.empty-state-text {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.bait-list > .empty-state-card,
.recipe-list > .empty-state-card {
  grid-column: 1 / -1;
}

.saved-summary > .empty-state-card,
.saved-component-picker > .empty-state-card,
.cart-list > .empty-state-card {
  grid-column: 1 / -1;
  padding: 16px 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 28px 82px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 10px;
}

.saved-check {
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.cart-item img,
.cart-item-placeholder {
  grid-row: 1 / 3;
  width: 82px;
  height: 82px;
  border-radius: 8px;
  background: #050505;
  object-fit: contain;
}

.cart-item-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.cart-item-name {
  display: grid;
  gap: 4px;
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.18;
}

.cart-item-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.cart-item-controls {
  display: grid;
  grid-template-columns: 34px 58px 34px;
  grid-column: 3;
  grid-row: 2;
  align-self: start;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.cart-qty-button,
.cart-remove-button,
.cart-add-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--text);
  font-weight: 900;
}

.cart-qty {
  color: var(--amount);
  font-weight: 900;
  text-align: center;
}

.cart-qty-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--amount);
  font-weight: 900;
  text-align: center;
}

.cart-remove-button {
  grid-column: 1 / -1;
  color: var(--danger);
  font-size: 0.78rem;
}

.cart-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recipe-origin {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.recipe-badge {
  display: inline-flex;
  width: fit-content;
  margin: -6px 0 12px;
  border: 1px solid rgba(114, 214, 95, 0.35);
  border-radius: 999px;
  background: rgba(114, 214, 95, 0.1);
  color: var(--accent);
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 900;
}

.recipe-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 0 14px;
  border-radius: 8px;
  background: #101010;
  object-fit: cover;
}

.recipe-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.meta-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 10px;
}

.meta-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-value {
  margin: 2px 0 0;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.15;
}

.meta-value.water {
  color: var(--water);
}

.meta-value.amount {
  color: var(--amount);
}

.component-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.component-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.component-row .cart-add-button {
  justify-self: end;
}

.component-row img,
.component-picker img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #101010;
  object-fit: cover;
}

.component-image-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}

.component-share {
  color: var(--text);
  font-weight: 900;
}

.component-name {
  display: grid;
  gap: 3px;
}

.component-meta {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.component-water {
  color: var(--water);
}

.component-amount {
  color: var(--amount);
}

.recipe-details {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 0.96rem;
}

.recipe-details p {
  margin: 0;
}

.recipe-details strong {
  color: var(--text);
}

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

.stage-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
  padding: 12px;
}

.stage-card h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.2;
}

.stage-card p {
  margin: 0;
  color: var(--muted);
}

.technique-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
  overflow: hidden;
}

.technique-block summary {
  min-height: 44px;
  padding: 12px;
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
}

.technique-content {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.component-picker {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.component-picker-row {
  display: grid;
  grid-template-columns: auto 44px minmax(0, 1fr) minmax(58px, 74px);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 8px;
}

.component-picker-row.selected {
  border-color: var(--accent);
  background: rgba(114, 214, 95, 0.08);
}

.component-picker-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.component-picker-name {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
}

.component-picker-ratio {
  color: var(--water);
  font-size: 0.8rem;
  font-weight: 900;
}

.component-share-input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 8px;
  text-align: center;
}

.recipe-calculation {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 12px;
  color: var(--muted);
}

.recipe-calculation strong {
  color: var(--accent);
  font-size: 1.25rem;
}

.bait-list.tile-mode {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 2.8vw, 10px);
}

.bait-tile {
  position: relative;
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: clamp(7px, 2.5vw, 8px);
  text-align: left;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.bait-tile,
.bait-list-item {
  cursor: pointer;
}

.bait-tile-image,
.bait-tile-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #101010;
  object-fit: contain;
}

.bait-tile-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 2rem;
  font-weight: 900;
}

.bait-tile-name {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  color: var(--text);
  min-height: 2.3em;
  font-size: clamp(0.76rem, 3.35vw, 0.88rem);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bait-measure-meta {
  color: var(--muted);
  font-weight: 900;
}

.bait-measure-meta.card {
  margin: 2px 0 14px;
  font-size: 2.2rem;
  line-height: 1;
}

.bait-measure-meta.card .component-amount {
  font-size: 1.25rem;
  vertical-align: middle;
}

.bait-measure-meta.tile {
  margin-top: 7px;
  font-size: clamp(0.8rem, 3.35vw, 0.92rem);
  line-height: 1.15;
}

.bait-measure-meta.list {
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.15;
}

.bait-list-item {
  position: relative;
  display: grid;
  grid-template-columns: clamp(52px, 15vw, 58px) minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px;
  text-align: left;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.cart-add-button {
  width: 34px;
  min-height: 34px;
  border-color: #353535;
  background: #121212;
  color: var(--accent);
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.bait-tile .cart-add-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.bait-tile .bait-measure-meta.tile {
  min-height: 32px;
  padding-right: 40px;
  white-space: nowrap;
}

.card {
  position: relative;
}

.card > .card-top .cart-add-button {
  position: absolute;
  right: 18px;
  bottom: 18px;
}

.bait-list-image,
.bait-list-placeholder {
  width: clamp(52px, 15vw, 58px);
  height: clamp(52px, 15vw, 58px);
  border-radius: 8px;
  background: #101010;
  object-fit: contain;
}

.bait-list-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 900;
}

.bait-list-content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.bait-list-name {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(0.86rem, 3.5vw, 0.96rem);
  font-weight: 900;
  line-height: 1.18;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bait-list-item .tag-list {
  margin-top: 4px;
  max-height: 24px;
  overflow: hidden;
}

.bait-list-item .tag-badge {
  padding: 3px 7px;
  font-size: clamp(0.62rem, 2.8vw, 0.68rem);
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(14px, 4vw, 18px);
  padding-bottom: 64px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.bait-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 0 14px;
  border-radius: 8px;
  background: #101010;
  object-fit: contain;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.original-name {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.25;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tag-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #101010;
  color: var(--muted);
  padding: 4px 7px;
  font-size: clamp(0.66rem, 2.8vw, 0.72rem);
  font-weight: 900;
  line-height: 1;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.delete-button {
  width: 34px;
  height: 30px;
  border: 1px solid rgba(255, 123, 123, 0.55);
  border-radius: 8px;
  background: rgba(255, 123, 123, 0.08);
  color: var(--danger);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.gluten-badge {
  min-width: 48px;
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 6px 7px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
}

.gluten-badge.needs-addition {
  color: var(--warning);
  background: rgba(240, 184, 79, 0.1);
}

.gluten-badge.contains {
  color: var(--info);
  background: rgba(100, 181, 246, 0.1);
}

.ratio-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ratio {
  margin: 2px 0 14px;
  color: var(--accent);
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.ratio.long {
  font-size: 1.55rem;
  line-height: 1.12;
}

.details {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 0.96rem;
}

.details p {
  margin: 0;
}

.details strong {
  color: var(--text);
  font-weight: 700;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: 18px 14px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.78);
}

.modal.open {
  display: block;
}

.modal-panel {
  width: min(100%, 560px);
  margin: 0 auto;
}

.modal-close {
  position: sticky;
  top: 0;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 44px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-light);
  color: var(--text);
  font-weight: 900;
}

@media (min-width: 560px) {
  main {
    padding: 32px 22px 48px;
  }

  .toolbar {
    margin-right: -22px;
    margin-left: -22px;
    padding-right: 22px;
    padding-left: 22px;
  }

  .bait-list {
    grid-template-columns: 1fr;
  }

  .bait-list.tile-mode {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  main {
    padding-right: 10px;
    padding-left: 10px;
  }

  .app-tabs {
    grid-template-columns: 48px repeat(2, minmax(0, 1fr));
  }

  .tab-button {
    padding: 0 4px;
    font-size: 0.74rem;
  }

  .toolbar {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) 46px 50px;
    gap: 6px;
  }

  .search-input {
    min-height: 46px;
    font-size: 0.92rem;
  }

  .add-button,
  .cart-button {
    min-height: 46px;
  }

  .filter-chip,
  .tag-filter-button,
  .recipe-filter-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .bait-list.tile-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .bait-tile-name {
    font-size: 0.74rem;
  }

  .bait-measure-meta.tile {
    font-size: 0.78rem;
  }

  .bait-tile .cart-add-button {
    right: 7px;
    bottom: 7px;
    width: 32px;
    min-height: 32px;
  }

  .bait-tile .bait-measure-meta.tile {
    padding-right: 36px;
  }

  .component-row {
    grid-template-columns: 40px minmax(0, 1fr) 34px;
    gap: 8px;
  }

  .component-row img,
  .component-image-button,
  .component-picker img {
    width: 40px;
    height: 40px;
  }

  .component-picker-row {
    grid-template-columns: auto 40px minmax(0, 1fr);
  }

  .component-share-input {
    grid-column: 3;
    grid-row: 2;
    width: 100%;
  }

  .cart-item {
    grid-template-columns: 26px 72px minmax(0, 1fr);
  }

  .cart-item img,
  .cart-item-placeholder {
    width: 72px;
    height: 72px;
  }

  .cart-item-controls {
    grid-column: 3;
    grid-row: 2;
    grid-template-columns: 38px minmax(48px, 1fr) 38px;
  }

  .saved-summary {
    grid-template-columns: 1fr;
  }

  .hub-author {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .cart-actions {
    grid-template-columns: 1fr;
  }

  .store-card .form-actions,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .modal {
    padding-right: 10px;
    padding-left: 10px;
  }
}

@media (max-width: 340px) {
  .bait-list.tile-mode {
    grid-template-columns: 1fr;
  }

  .bait-tile-name {
    font-size: 0.86rem;
  }
}
