/* ==============================================================
   Fields — v0.101
   What prints on each wine, in what order. One panel, drawn into the
   desk's drawer and into the phone's Fields sheet.
   ============================================================== */

.fx { font-family: var(--font-ui); color: var(--ink); }
.fx-lead { margin: 0 0 10px; font-size: 14px; color: var(--ink-soft); line-height: 1.4; }

/* The sample: a wine from the list, set the way the page sets it. */
.fx-sample {
  border: 1px solid var(--chrome-line-2); border-radius: var(--r);
  background: var(--paper); padding: 10px 12px 11px; margin-bottom: 14px;
}
.fx-sample small {
  display: block; font-family: var(--font-ui-2); font-size: 9.5px;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px;
}
.fx-s-head { display: flex; gap: 10px; align-items: baseline; }
.fx-s-vin { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 14.5px; }
.fx-s-name { font-size: 15.5px; line-height: 1.3; }
.fx-s-line { font-size: 13.5px; line-height: 1.4; color: var(--ink-soft); margin-top: 2px; }
.fx-s-line.is-none { color: var(--ink-faint); }

/* The list */
.fx-list { list-style: none; margin: 0; padding: 0; position: relative; }
.fx-row {
  display: flex; align-items: center; gap: 4px;
  min-height: 38px; padding: 0 2px 0 0;
  border-bottom: 1px solid var(--chrome-line-2);
  background: var(--lift-2);
}
.fx-list .fx-row:first-child { border-top: 1px solid var(--chrome-line-2); }
.fx-row.is-drag {
  position: relative; z-index: 2;
  box-shadow: 0 4px 14px rgba(0,0,0,.14); border-color: transparent;
  background: var(--lift);
}
.fx-list.is-dragging { user-select: none; -webkit-user-select: none; }

.fx-grip {
  flex: none; width: 26px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-faint); cursor: grab; touch-action: none;
}
.fx-grip:active { cursor: grabbing; color: var(--accent-ink); }
.fx-grip svg, .fx-arrow svg, .fx-box svg, .fx-chip svg {
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.fx-grip svg { width: 15px; height: 15px; }

.fx-tog {
  flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 9px;
  border: 0; background: none; padding: 7px 4px; text-align: left; cursor: pointer;
  font: inherit; font-size: 15px; color: var(--ink-faint);
  -webkit-tap-highlight-color: transparent;
}
.fx-box {
  flex: none; width: 17px; height: 17px; border-radius: var(--r);
  border: 1px solid var(--chrome-line); background: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; color: transparent;
}
.fx-box svg { width: 13px; height: 13px; stroke-width: 2; }
.fx-row.is-on .fx-tog { color: var(--ink); }
.fx-row.is-on .fx-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.fx-tog:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r); }

.fx-chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 7px; border-radius: var(--r);
  border: 1px solid var(--chrome-line-2); background: transparent;
  font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-soft); cursor: pointer;
}
.fx-chip svg { width: 13px; height: 13px; }
.fx-chip.is-on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }

.fx-mv { flex: none; display: inline-flex; }
.fx-arrow {
  width: 26px; height: 30px; border: 0; background: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft); cursor: pointer; border-radius: var(--r);
}
.fx-arrow svg { width: 15px; height: 15px; }
.fx-arrow:hover:not([disabled]) { background: var(--accent-soft); color: var(--accent-ink); }
.fx-arrow[disabled] { opacity: .25; cursor: default; }

/* The guest note: its own line, so not in the order. */
.fx-row-note { margin-top: 10px; border-top: 1px solid var(--chrome-line-2); padding-left: 26px; }
.fx-aside { flex: none; font-size: 12.5px; color: var(--ink-faint); padding-right: 6px; }

.fx-from, .fx-kept {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 12px 0 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.4;
}
.fx-from .tb-out, .fx-kept .tb-out { flex: none; }
.fx-kept { color: var(--ink-soft); }
.fx-help { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-faint); line-height: 1.45; }

/* ---- The desk: the toolbar button sits lit while the panel is up. ---- */
#btnFields.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

/* ---- The phone ---- */
.fx-phone .fx-row { min-height: 48px; background: transparent; }
.fx-phone .fx-tog { font-size: 16.5px; padding: 11px 4px; }
.fx-phone .fx-box { width: 20px; height: 20px; }
.fx-phone .fx-grip { width: 34px; height: 44px; }
.fx-phone .fx-arrow { width: 36px; height: 40px; }
.fx-phone .fx-chip { height: 30px; font-size: 13.5px; }
.fx-phone .fx-row-note { padding-left: 34px; }
.fx-phone .fx-sample { border-radius: var(--r-m); }

/* The dedicated button, on the right of the Edit / Preview band. */
.m-fields-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: none; align-items: center; gap: 5px;
  height: 34px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--chrome-line-2); background: var(--lift-2);
  font-family: var(--font-ui); font-size: 14.5px; color: var(--accent-ink);
  -webkit-tap-highlight-color: transparent;
}
.m-fields-btn svg, .m-fields-go svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round;
}
body.mobile.m-edit .m-fields-btn { display: inline-flex; }
body.mobile.m-edit .m-seg { justify-content: flex-start; padding-left: 12px; }
.m-fields-btn:active { background: var(--accent-soft); }

/* The way in from the Format sheet: what prints now, and a chevron. */
.m-fields-go {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 13px; border: 1px solid var(--m-line); border-radius: var(--r-m); background: var(--m-field);
  font-family: var(--font-ui); font-size: 15.5px; color: var(--ink); text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.m-fields-go svg { color: var(--accent-ink); flex: none; }
.m-fields-go-t { flex: 1 1 auto; min-width: 0; }
.m-fields-go-c { flex: none; color: var(--ink-faint); font-size: 20px; line-height: 1; }

[data-theme="dark"] .fx-sample { background: var(--lift); }
[data-theme="dark"] .fx-box { background: var(--lift-2); border-color: var(--chrome-line); }
[data-theme="dark"] .fx-row.is-on .fx-box { background: var(--accent); border-color: var(--accent); }

/* A guest note under the detail keeps its own line on the phone's cards. */
body.mobile .m-row .m-row-detail { white-space: pre-line; }
