/* clamp() ジェネレーター（2026-10-26、/apps/clamp/ から引っ越し）。デザイン：reference/design_handoff_125naroom_clamp */
/* 本体 */
.cl { margin-top: 36px; display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "in pv" "in out"; column-gap: 64px; row-gap: 28px; align-content: start; }
.pv { grid-area: pv; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.out { grid-area: out; min-width: 0; }
.in { grid-area: in; min-width: 0; }

/* グラフ */
.graph { display: block; width: 100%; height: auto; overflow: visible; touch-action: none; cursor: grab; outline: none; user-select: none; -webkit-user-select: none; }
.graph.is-drag { cursor: grabbing; }
.graph text { font-family: "Jost", sans-serif; font-size: 11px; letter-spacing: .04em; fill: var(--sub); }
.graph .dash { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; stroke-linecap: round; }
.graph .rail { stroke: var(--ink); stroke-width: 1; }
.graph .drop { stroke: var(--sub); stroke-width: 1; }
.graph .dot { fill: var(--y); }
.graph .curve { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.graph .none { fill: none; stroke: var(--sub); stroke-width: 1.25; stroke-dasharray: 2 5; stroke-linecap: round; }
.graph .hit { fill: transparent; }
.graph .knob { fill: var(--bg); stroke: var(--ink); stroke-width: 1.25; }
.graph:hover .knob { fill: var(--soft); stroke-width: 1.5; }
.graph.is-drag .knob { fill: var(--ink); stroke-width: 1.5; }
.graph .ring { fill: none; stroke: var(--ink); stroke-width: 1; opacity: 0; }
.graph:focus-visible .ring { opacity: 1; }

.pv-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.readout { display: flex; align-items: baseline; gap: 16px; font-family: "Jost", sans-serif; font-weight: 200; font-size: 56px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.readout small { font-size: .42em; font-weight: 300; margin-left: 3px; letter-spacing: 0; }
.arrow { display: block; width: 36px; height: 12px; overflow: visible; align-self: center; }
.arrow polyline { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.sample { line-height: 1.2; letter-spacing: .06em; padding-bottom: 2px; }
.sample .en { letter-spacing: 0; }

/* CSS */
.out { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0 22px; }
.out-head { display: flex; justify-content: space-between; align-items: center; }
.label { font-family: "Jost", sans-serif; font-size: 11px; letter-spacing: .2em; color: var(--sub); }
.unit { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.unit button { height: 34px; min-width: 52px; padding: 0 14px; border-radius: 999px; font-family: "Jost", sans-serif; font-size: 14px; letter-spacing: .06em; }
.unit button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.unit button:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.out-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.code { flex: 1 1 360px; min-width: 0; font-family: "Jost", sans-serif; font-weight: 300; font-size: 22px; line-height: 1.45; letter-spacing: .01em; text-wrap: pretty; overflow-wrap: anywhere; }
.code .s { color: var(--sub); }
.code.is-none { color: var(--sub); }
.copy { flex: 0 0 auto; height: 48px; padding: 0 28px; border-radius: 999px; border: 1px solid var(--ink); font-size: 14px; letter-spacing: .1em; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 160ms, color 160ms; }
.copy svg { display: none; }
.copy svg polyline { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.copy:hover { background: var(--soft); }
.copy:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.copy.is-done, .copy.is-done:hover { background: var(--ink); color: var(--bg); }
.copy.is-done svg { display: block; }
.copy:disabled { border-color: var(--line); color: var(--sub); background: transparent; cursor: default; }

/* 入力 */
.in { display: flex; flex-direction: column; gap: 32px; }
.groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px 20px; align-items: start; }
.group { display: block; }
.group legend, .group-title { font-size: 13px; font-weight: 500; letter-spacing: .1em; }
.group legend { margin-bottom: 10px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.field { display: flex; flex-direction: column; gap: 2px; cursor: text; }
.field > span:first-child { font-size: 11px; letter-spacing: .1em; color: var(--sub); }
.box { display: flex; align-items: baseline; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.box:hover { border-bottom-color: var(--sub); }
.box.is-bad { border-bottom: 1px dashed var(--ink); }
.box:focus-within { border-bottom: 1.5px solid var(--ink); padding-bottom: 5.5px; }
.box input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: "Jost", sans-serif; font-weight: 300; font-size: 30px; line-height: 1.2; padding: 0; border-radius: 0; }
.box small { font-family: "Jost", sans-serif; font-size: 13px; color: var(--sub); }

.errs { display: flex; flex-direction: column; gap: 6px; margin-top: -6px; }
.errs:empty { display: none; }
.err { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.7; }
.err svg { display: block; flex: none; margin-top: 3px; }
.err svg circle { fill: none; stroke: currentColor; stroke-width: 1.25; }
.err svg .c { fill: currentColor; stroke: none; }
.err span { flex: 1; }
.err button { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

.presets { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); display: flex; align-items: center; gap: 6px; font-size: 13px; letter-spacing: .06em; line-height: 1; }
.chips button:hover { background: var(--soft); }
.chips button:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.chips button.is-on { border-color: var(--ink); }
.chips .r { font-family: "Jost", sans-serif; font-size: 12px; color: var(--sub); letter-spacing: 0; }

/* スマホ */
@media (max-width: 767px) {
  .cl { margin-top: 24px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "pv" "out" "in"; row-gap: 18px; }
  .pv { gap: 8px; }
  .readout { font-size: 34px; gap: 8px; }
  .arrow { width: 22px; }
  .out { padding: 12px 0 14px; }
  .code { font-size: 15px; flex-basis: 100%; }
  .copy { flex: 1 1 100%; height: 44px; }
  .in { gap: 16px; }
  .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
  .fields { gap: 12px; }
  .box input { font-size: 22px; }
  .chips button { height: 36px; }
}
