/*
  15-menu.css — v41.20 the Customise Menu sheet

  Width budget, which is what the old version got wrong: a bottom sheet on a
  360px phone gives about 312px of usable row after the sheet's own padding.
  The previous row packed a rank badge, icon, name, a pill-shaped checkbox
  toggle and two arrow buttons into that, and the last arrow was clipped off
  the edge of the screen.

  Here: icon 26 + gaps 16 + three 38px buttons = 156, leaving ~156 for the
  name — comfortable for every label in NAV_DEFS. Hidden rows carry one button
  instead of three, because reordering something that isn't in the bar does
  nothing.

  Unlayered, loaded after styles.css. No !important.
*/

.menu-cust { display: grid; gap: var(--s3); }

.menu-help {
  margin: 0;
  font-size: var(--ui-meta);
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ==========================================================
   Live preview of the resulting bar
   ========================================================== */
.menu-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  background: var(--hull);
}
.mp-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(232, 192, 105, .28);
  color: #f3e6c8;
  font-size: var(--ui-meta);
  font-weight: var(--fw-head);
  white-space: nowrap;
}
.mp-pill .menu-ico { width: 14px; height: 14px; }
.mp-pill .menu-ico svg { stroke: var(--brass-bright); }

/* ==========================================================
   Layout templates
   ========================================================== */
.menu-tpl { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==========================================================
   Section heads
   ========================================================== */
.menu-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--s2);
}
.menu-head h3 {
  margin: 0;
  font-size: var(--ui-meta);
  font-weight: var(--fw-display);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.menu-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--chart-2);
  border: 1px solid var(--line-strong);
  font-size: var(--ui-meta);
  font-weight: var(--fw-display);
  color: var(--ink-soft);
}

/* ==========================================================
   Rows
   ========================================================== */
.menu-list { display: grid; gap: 5px; }

.menu-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--chart);
}
.menu-row.is-hidden { background: transparent; border-style: dashed; min-height: 44px; }

.menu-ico { width: 20px; height: 20px; flex: 0 0 auto; display: block; }
.menu-ico svg {
  width: 100%; height: 100%;
  fill: none; stroke: var(--muted);
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.menu-row.is-hidden .menu-ico svg { stroke: #a08c67; }

.menu-name {
  flex: 1;
  min-width: 0;
  font-weight: var(--fw-head);
  font-size: .9rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-row.is-hidden .menu-name { color: var(--ink-soft); font-weight: var(--fw-emph); }

.menu-acts { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }

.menu-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--chart-2);
  color: var(--ink);
  font: inherit;
  font-size: var(--ui-meta);
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s ease, border-color .12s ease;
}
.menu-btn:hover { background: var(--paper3); border-color: var(--brass); }
.menu-btn:active { transform: translateY(1px); }
.menu-btn:disabled { opacity: .38; cursor: default; }
.menu-btn:disabled:hover { background: var(--chart-2); border-color: var(--line-strong); }

.menu-btn.menu-remove { color: #8f2318; font-weight: var(--fw-display); font-size: 1.05rem; }
.menu-btn.menu-add {
  background: var(--lagoon-deep);
  border-color: transparent;
  color: #eaf6f4;
  font-weight: var(--fw-display);
  font-size: .95rem;
}
.menu-btn.menu-add:hover { background: var(--lagoon); border-color: transparent; }

.menu-lock {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 9px;
  border-radius: var(--r-s);
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: var(--ui-meta);
  font-weight: var(--fw-display);
  letter-spacing: .05em;
  text-transform: uppercase;
}

@media (max-width: 340px) {
  .menu-btn { width: 34px; height: 34px; }
  .menu-lock { height: 34px; padding: 0 7px; }
  .menu-row { min-height: 48px; gap: 6px; }
}

/* v41.81 — a modern pass over the Customise Menu, and the parchment context.
   The preset chips used the dark-screen .fchip styling, which washes out on
   this sheet exactly as the Connections chips did (v41.76). */
.menu-tpl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.menu-tpl-card {
  display: grid; gap: 3px; text-align: left; cursor: pointer; font: inherit;
  padding: 10px 12px; border-radius: 14px;
  border: 1px solid rgba(120, 92, 43, .34); background: rgba(120, 92, 43, .08); color: #3f3018;
}
.menu-tpl-card:hover { background: rgba(120, 92, 43, .15); }
.menu-tpl-card.active { background: var(--brass); border-color: transparent; color: #1b1105; }
.menu-tpl-name { font-weight: var(--fw-head); }
.menu-tpl-lead { font-size: var(--t0); color: #5d4a2c; }
.menu-tpl-card.active .menu-tpl-lead, .menu-tpl-card.active .menu-tpl-count { color: rgba(27, 17, 5, .72); }
.menu-tpl-count { font-size: var(--t0); color: #6e5b40; font-weight: var(--fw-emph); }

.menu-list { display: grid; gap: 6px; }
.menu-list-hidden { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.menu-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; min-height: 48px; border-radius: 12px; font: inherit; text-align: left;
  border: 1px solid rgba(120, 92, 43, .28); background: rgba(255, 252, 240, .5); color: var(--ink);
}
.menu-row.is-hidden { border-style: dashed; cursor: pointer; background: transparent; }
.menu-row.is-hidden:hover { background: rgba(120, 92, 43, .1); }
.menu-row.is-anchored { background: rgba(120, 92, 43, .12); }
.menu-grip { cursor: grab; touch-action: none; color: #6e5b40; padding: 0 2px; font-size: 1rem; }
.menu-grip-off { cursor: default; opacity: .45; }
.menu-row.is-dragging { opacity: .9; box-shadow: 0 8px 20px rgba(31, 18, 48, .22); }
.menu-name { flex: 1 1 auto; font-weight: var(--fw-emph); display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.menu-name small { font-weight: var(--fw-emph); font-size: var(--t0); color: #584526; }  /* AA on the anchored row's tint */
.menu-acts { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.menu-btn { min-width: 38px; min-height: 38px; border-radius: 10px; }
.menu-lock {
  font-size: var(--ui-meta); letter-spacing: .06em; text-transform: uppercase; font-weight: var(--fw-head);
  color: #6e5b40; padding: 0 6px;
}
@media (max-width: 480px) { .menu-list-hidden { grid-template-columns: 1fr; } }
