/* Interface fragments of the Edge Command Center shown on the pages (roots marked data-ui), and form fields.
   Inside a fragment the product's own conventions apply: 10px panels, 1px edges, small labels, tabular figures. */

[data-ui] {
  --ui-panel: #141414;
  --ui-raised: #1C1C1C;
  --ui-edge: rgba(250, 250, 250, 0.1);
  --ui-edge-strong: rgba(250, 250, 250, 0.18);
  --ui-ink: #FAFAFA;
  --ui-muted: rgba(250, 250, 250, 0.66);
  font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  color: var(--ui-ink);
  font-variant-numeric: tabular-nums;
}

/* cards and tables */
[data-ui].ui-card, [data-ui] .ui-card { background: var(--ui-panel); border: 1px solid var(--ui-edge); border-radius: 10px; padding: 18px 20px; font-size: 14px; line-height: 1.4; }
[data-ui] .ui-card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 15px; font-weight: 600; }
[data-ui] .ui-muted { color: var(--ui-muted); font-weight: 400; font-size: 13px; }
[data-ui] .ui-label { display: block; color: var(--ui-muted); font-size: 13px; }
[data-ui] .ui-foot { margin-top: 12px; color: var(--ui-muted); font-size: 12.5px; }
[data-ui] .ui-table { width: 100%; border-collapse: collapse; font-size: 14px; }
[data-ui] .ui-table th, [data-ui] .ui-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--ui-edge); vertical-align: top; }
[data-ui] .ui-table thead th { color: var(--ui-muted); font-weight: 400; font-size: 12.5px; }
[data-ui] .ui-table .num { text-align: right; white-space: nowrap; }
[data-ui] .ui-table tfoot th, [data-ui] .ui-table tfoot td { border-bottom: 0; font-weight: 600; padding-top: 12px; }
[data-ui] .ui-table tr.is-sel td, [data-ui] .ui-table tr.is-sel th { background: var(--ui-raised); }
[data-ui] .ui-table tr.is-neg td:last-child, [data-ui] .is-neg { color: #FF8A8A; }
[data-ui] .ui-table td.is-warn { color: #E8A33C; }
[data-ui] .ui-sub { display: block; color: var(--ui-muted); font-size: 12.5px; }
[data-ui] .ui-dl { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
[data-ui] .ui-dl > div { display: flex; justify-content: space-between; gap: 12px; }
[data-ui] .ui-dl dt { color: var(--ui-muted); }
[data-ui] .ui-dl dd { font-weight: 600; }
[data-ui] .ui-dl--row { flex-direction: row; flex-wrap: wrap; gap: 20px 32px; }
[data-ui] .ui-dl--row > div { flex-direction: column; gap: 2px; }
[data-ui] .ui-dl--row dd { font-size: 20px; }
[data-ui] .ui-dl-total { border-top: 1px solid var(--ui-edge); padding-top: 8px; }
[data-ui] .ui-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--ui-raised); color: var(--ui-ink); }
[data-ui] .ui-pill--ok { background: rgba(31, 214, 95, 0.16); color: #5BE38A; }
[data-ui] .ui-pill--neg { background: rgba(255, 107, 107, 0.16); color: #FF9B9B; }
[data-ui] .ui-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 6px; background: #1FD65F; color: #06170D; font-size: 13px; font-weight: 600; }

/* segmented choice, toggle, slider */
[data-ui] .ui-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--ui-raised); border-radius: 8px; }
[data-ui] .ui-seg button, [data-ui] .ui-seg label span { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ui-muted); font: 600 13px/1 "Libre Franklin", sans-serif; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
[data-ui] .ui-seg button:hover, [data-ui] .ui-seg label span:hover { color: var(--ui-ink); }
[data-ui] .ui-seg button[aria-pressed="true"], [data-ui] .ui-seg input:checked + span { background: #FAFAFA; color: #0A0A0A; }
[data-ui] .ui-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
[data-ui] .ui-seg input:focus-visible + span { outline: 3px solid #1FD65F; outline-offset: 1px; }
[data-ui] .ui-seg label { display: inline-flex; }
[data-ui] .ui-seg--lg button { min-height: 44px; padding: 0 16px; font-size: 15px; }
[data-ui] .ui-seg--full { display: flex; }
[data-ui] .ui-seg--full label { flex: 1; }
[data-ui] .ui-seg--full label span { width: 100%; justify-content: center; min-height: 40px; }
[data-ui] .ui-toggle { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; font-weight: 600; cursor: pointer; }
[data-ui] .ui-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
[data-ui] .ui-toggle-ui { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--ui-edge-strong); transition: background-color 180ms ease; flex: none; }
[data-ui] .ui-toggle-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FAFAFA; transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1); }
[data-ui] .ui-toggle input:checked + .ui-toggle-ui { background: #1FD65F; }
[data-ui] .ui-toggle input:checked + .ui-toggle-ui::after { transform: translateX(18px); }
[data-ui] .ui-toggle input:focus-visible + .ui-toggle-ui { outline: 3px solid #1FD65F; outline-offset: 2px; }
[data-ui] .ui-slider { display: flex; flex-direction: column; gap: 10px; max-width: 420px; font-size: 16px; font-weight: 600; }
[data-ui] .ui-slider span { display: flex; justify-content: space-between; }
[data-ui] input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }
[data-ui] input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--ui-edge-strong); }
[data-ui] input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--ui-edge-strong); }
[data-ui] input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #1FD65F; border: 3px solid #0A0A0A; }
[data-ui] input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #1FD65F; border: 3px solid #0A0A0A; }
[data-ui] input[type="range"]:focus-visible { outline: 3px solid #1FD65F; outline-offset: 4px; }

/* hero chips */
[data-ui].chip { width: min(320px, 100%); background: var(--ui-raised); border-radius: 10px; padding: 12px 14px 10px; font-size: 14px; }
[data-ui] .chip-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600; }
[data-ui] .chip-top output { font-size: 17px; font-weight: 700; }
[data-ui] .chip-note { color: var(--ui-muted); font-size: 12.5px; margin-top: 2px; }
[data-ui] .chip-switch { display: inline-flex; align-items: center; gap: 10px; }
[data-ui] [role="switch"] { position: relative; width: 52px; height: 30px; border: 0; border-radius: 15px; background: #1FD65F; cursor: pointer; padding: 0; }
[data-ui] [role="switch"] span { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #0A0A0A; transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1); transform: translateX(22px); }
[data-ui] [role="switch"][aria-checked="false"] { background: #FAFAFA; }
[data-ui] [role="switch"][aria-checked="false"] span { transform: none; }
[data-ui].chip--switch .chip-top { align-items: center; min-height: 40px; }

/* waterfall */
[data-ui] .wf-list { display: flex; flex-direction: column; gap: 4px; }
[data-ui] .wf-row { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) 7em; align-items: center; gap: 12px; font-size: 13.5px; min-height: 26px; }
[data-ui] .wf-label { color: var(--ui-muted); }
[data-ui] .wf-track { position: relative; height: 14px; }
[data-ui] .wf-bar { position: absolute; top: 0; bottom: 0; left: var(--l); width: max(2px, var(--w)); border-radius: 2px; background: #FAFAFA; transform-origin: left; }
[data-ui] .wf-row.is-cost .wf-bar { background: #FF6B6B; }
[data-ui] .wf-amt { text-align: right; }
[data-ui] .wf-net { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--ui-edge); font-weight: 700; }
[data-ui] .wf-net .wf-label { color: var(--ui-ink); }
[data-ui] .wf-net .wf-bar { background: #1FD65F; }
[data-ui].wf--wide { max-width: 980px; padding: 24px 28px; }
[data-ui].wf--wide .wf-row { font-size: 15px; min-height: 32px; grid-template-columns: 11em minmax(0, 1fr) 8em; }
[data-ui].wf--wide .wf-track { height: 18px; }

/* how it works */
[data-ui].how-call { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--ui-raised); border-radius: 8px; padding: 16px 20px; font-size: 15px; }
[data-ui] .how-file { font-weight: 600; }
[data-ui] .how-val { margin-left: auto; font-weight: 600; }
[data-ui].how-call .ui-btn { margin-left: auto; }

/* raw orders */
[data-ui].io-input { width: min(34em, 100%); display: flex; flex-direction: column; gap: 10px; }
[data-ui] .io-label { font-size: 14px; font-weight: 600; color: var(--ui-muted); }
[data-ui] .io-input textarea { /* taste-skill-ignore: literal CSV input */ width: 100%; min-height: 15em; resize: vertical; padding: 18px 20px; border: 1px solid var(--ui-edge-strong); border-radius: 10px; background: #0A0A0A; color: #FAFAFA; font: 18px/1.65 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; white-space: pre; overflow-x: auto; }
[data-ui] .io-input textarea:focus-visible { outline: 3px solid #1FD65F; outline-offset: 2px; }
[data-ui].io-card { width: min(520px, 100%); }

/* shape the report */
[data-ui].shape-card { width: min(420px, 100%); padding: 22px 24px; }
[data-ui] .shape-fig { margin: 4px 0 14px; }
[data-ui] .shape-fig b { display: block; font-size: 40px; line-height: 1.05; letter-spacing: -0.02em; }
[data-ui] .shape-bar { position: relative; height: 10px; border-radius: 5px; background: var(--ui-raised); }
[data-ui] .shape-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--m) * 100 / 30); border-radius: 5px; background: #E8A33C; transition: width 300ms cubic-bezier(0.22, 1, 0.36, 1), background-color 200ms ease; }
[data-ui] .shape-fill.is-ok { background: #1FD65F; }
[data-ui] .shape-target { position: absolute; top: -5px; bottom: -5px; left: calc(var(--t) * 100 / 30); width: 3px; margin-left: -1px; border-radius: 2px; background: #FAFAFA; transition: left 300ms cubic-bezier(0.22, 1, 0.36, 1); }
[data-ui] .shape-status { margin: 10px 0 16px; font-size: 13.5px; }
[data-ui] .shape-status.is-ok { color: #5BE38A; }

/* first step dialog */
[data-ui].dialog { width: min(440px, 100%); background: #141414; color: #FAFAFA; border-radius: 12px; padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.2); }
[data-ui] .dialog-h { font-size: 20px; font-weight: 700; }
[data-ui] .ui-seg-field legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
[data-ui] .dialog-hint { color: var(--ui-muted); font-size: 13.5px; margin-top: -6px; }

/* purchase steps */
[data-ui].step-ui { min-height: 216px; display: flex; flex-direction: column; gap: 8px; }
[data-ui] .su-select { border: 1px solid #1FD65F; border-radius: 6px; padding: 9px 12px; }
[data-ui] .su-opt { padding: 8px 12px; border-radius: 6px; background: var(--ui-raised); }
[data-ui] .su-opt:first-of-type { background: #FAFAFA; color: #0A0A0A; }
[data-ui] .su-note { color: var(--ui-muted); font-size: 13.5px; }
[data-ui] .su-btn { margin-top: auto; background: #1FD65F; color: #06170D; font-weight: 600; text-align: center; padding: 10px; border-radius: 6px; }

/* fields: inside fragments and in real forms */
.ui-field { display: flex; flex-direction: column; gap: 6px; font-family: "Libre Franklin", "Helvetica Neue", Arial, sans-serif; font-size: 14px; font-weight: 600; }
.ui-field--wide { grid-column: 1 / -1; }
.ui-field input, .ui-field select, .ui-field textarea { /* taste-skill-ignore: real form fields keep their outline */ width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid rgba(250, 250, 250, 0.16); border-radius: 4px; background: #0A0A0A; color: #FAFAFA; font: 400 16px/1.4 "Libre Franklin", "Helvetica Neue", Arial, sans-serif; }
.ui-field textarea { min-height: 120px; resize: vertical; }
.ui-field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23FAFAFA' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; padding-right: 40px; }
.ui-field input:focus-visible, .ui-field select:focus-visible, .ui-field textarea:focus-visible { outline: 3px solid #1FD65F; outline-offset: 1px; }
.ui-field [aria-invalid="true"] { border-color: #FF6B6B; border-width: 2px; }
.ui-btn-text { background: none; border: 0; padding: 4px 8px; border-radius: 4px; color: inherit; font: 600 14px "Libre Franklin", sans-serif; text-decoration: underline; cursor: pointer; }

/* phone */
@media (max-width: 860px) {
  [data-ui].chip { width: 100%; }
  [data-ui] .wf-row { grid-template-columns: 7.5em minmax(0, 1fr) 6.2em; font-size: 12.5px; gap: 8px; }
  [data-ui].wf--wide .wf-row { grid-template-columns: 8em minmax(0, 1fr) 6.6em; font-size: 13.5px; }
  [data-ui] .io-input textarea { font-size: 15px; min-height: 12em; }
  [data-ui].ui-card.io-card { padding: 16px 12px; overflow-x: auto; }
  [data-ui].io-card .ui-table { font-size: 12.5px; }
  [data-ui].io-card .ui-table th, [data-ui].io-card .ui-table td { padding-left: 3px; padding-right: 3px; }
  [data-ui].io-card .ui-card-h, [data-ui].io-card .ui-foot { padding-inline: 3px; }
  [data-ui].shape-card { padding: 16px 18px; }
  [data-ui] .shape-fig b { font-size: 30px; }
  [data-ui] .ui-seg--lg button { padding: 0 12px; font-size: 14px; }
  [data-ui].how-call .ui-btn, [data-ui] .how-val { margin-left: 0; }
}
@media (max-width: 600px) {
  [data-ui].ui-card, [data-ui] .ui-card { padding: 16px 14px; }
  [data-ui] .ui-table { font-size: 13px; }
  [data-ui] .ui-table th, [data-ui] .ui-table td { padding-left: 4px; padding-right: 4px; }
  [data-ui] .ui-table--proc th:nth-child(n+5), [data-ui] .ui-table--proc td:nth-child(n+5) { display: none; }
}
@media (max-width: 380px) {
  [data-ui].io-card .ui-table { font-size: 11.5px; }
  [data-ui].io-card .ui-table th, [data-ui].io-card .ui-table td { padding-left: 2px; padding-right: 2px; }
}
