/* generated by scripts/sync_prototype.py from the prototype: portal phone: chart.css. Do not edit. */
/* ============================================================
   KCM Trade — the instrument page on a phone (≤760px). Appended after
   the desktop sheet by build.py; every rule sits inside the one media
   query, so desktop never sees it.

   Markup (chart.js, behind K.isPhone()):
     .cx-top        back 44 · pair 44×30 · SYM / name · ★ 44
     .cx-price      the masthead: last 34 mono, chip, "vs prev close", time
                    (above .ctabs on every tab; view-transition-name cx-price)
     .ctabs         pill strip (style from shell.css)
     .panel.cx      OHLC 4-up · .cx-tfs (eight ≥40px cells) · .cx-read (one
                    scrolling line) · plot 250 · times · VOL 48 · RSI 48
                    (no .cx-bar-r, no ticket)
     #dock          .tk-sell · #dock-lots · .tk-buy   (K.DOCKS.Chart)
                    .dock.is-guard while it rises (taps ignored), .dock.is-armed
                    + .tk.is-arm while a Sell/Buy waits for its confirming tap
     .ticket-sheet  the order ticket inside the shell's sheet (K.openSheet)
   Every ticket rule is scoped to .ticket-sheet — never bare .ticket, which
   is also Support's ticket at style.css 1607.
   ============================================================ */
@media (max-width:760px){
  /* ---------- head ---------- */
  .cx-top{display:flex;align-items:center;gap:10px;min-height:56px}
  .cx-top .pair{width:44px;height:30px}
  .cx-top .pair-f,.cx-top .pair-b{width:28px;height:28px}
  .cx-top .pair-b{left:15px}
  .cx-top .pair.is-one{width:30px}
  .cx-title{min-width:0}
  .cx-title h1{font-size:20px}
  .cx-title p{font-size:12px;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .cx-tools{margin-left:auto}
  /* the star: shell hides .round in the top bar; here it is the one tool */
  .cx-tools .round{display:grid;width:44px;height:44px;margin-right:-4px;background:#fff;border:1px solid var(--line-2);
    transition:background var(--t-quick) var(--ease),color var(--t-quick) var(--ease)}
:where(html[data-appearance="dark"]) .cx-tools .round{background:#10152A}
  .cx-tools .round:active{background:#EEF1F7;transform:scale(.97)}
:where(html[data-appearance="dark"]) .cx-tools .round:active{background:rgba(255,255,255,0.1)}

  /* ---------- the price masthead, above the tabs on every tab ---------- */
  .cx-price{flex-direction:column;gap:0;margin:0 0 10px}
  .cx-last{font-size:34px}
  .cx-chg{margin-top:4px}
  .cx-when{margin-top:2px;font-size:12px}

  /* ---------- instrument tabs: pill style from shell, bleeds to the edge ---------- */
  .ctabs{margin:0 calc(-1 * var(--pad)) 12px;padding:0 var(--pad);scroll-padding:0 var(--pad)}
  .ctabs .mtab{padding:0 16px}

  /* ---------- the chart panel ---------- */
  /* .panel.cx: shell.css's .panel{padding:16px} is appended after this file
     and would win a plain .cx tie; the column is 347/362/402 at 375/390/430 */
  .panel.cx{padding:16px 14px 14px}
  .cx-ohlc{grid-template-columns:repeat(4,minmax(0,1fr));gap:0 8px;width:100%;margin:0}
  .cx-ohlc dt{font-size:10.5px}
  .cx-ohlc dd{font-size:13px}
  .cx-bar{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
  .cx-bar-r{display:none}
  /* eight timeframes in one row. The strip bleeds 4px into the panel padding
     on each side and keeps 2px of its own, so the cells are 40.4 wide at 375
     (319 + 8 − 4 = 323 / 8), 42.3 at 390, 47.3 at 430 — never under the 40px
     floor; narrower than that the strip scrolls and snaps instead of squeezing */
  .cx-tfs{width:100%;gap:0;margin:0 -4px;padding:2px;border-radius:12px;overflow-x:auto;overflow-y:hidden;
    scroll-snap-type:x proximity;overscroll-behavior-x:contain}
  .cx-tf{flex:1 1 0;min-width:40px;min-height:40px;padding:0;text-align:center;font-size:12.4px;scroll-snap-align:start}
  /* the readout: one line, 18px tall, that scrolls sideways under a right
     fade rather than wrapping (time · O H L C · change · Vol is ~430px of 11px
     mono, wider than any phone column). Every token keeps its width while a
     scrub rewrites it — mono digits, a signed change, the candle's time in the
     same shape at rest and under the finger — so the line above the plot
     never reflows. The MA legend is already hidden at ≤760 (style.css) */
  .cx-read{flex-wrap:nowrap;gap:0 10px;margin:10px 0 6px;font-size:11px;line-height:18px;min-height:18px;
    overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 22px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 22px),transparent)}
  .cx-read::-webkit-scrollbar{display:none}
  .cx-read > span{flex:none;white-space:nowrap;font-variant-numeric:tabular-nums}
  .cx-read > .up,.cx-read > .down{font-weight:500}
  /* the price axis: 62px holds "Ask 1.16148" at 9.6px (≈60px) whole */
  .cx-main,.cx-sub{grid-template-columns:minmax(0,1fr) 62px}
  .cx-times{margin-right:62px}
  /* a time label that would run past the panel's left padding starts at its
     candle instead of being centred on it (chart.js marks it .is-edge) */
  .cx-times .is-edge{transform:none}
  /* The plot fills what the shell is not using instead of sitting at a fixed
     height with grey beneath it. CSS owns the height so a rotation resizes it
     at once; chart.js mirrors this formula in plotPx() for its tag spacing.
     Keep the two in step if either changes. vh first, for engines without dvh. */
  .cx-plot,.cx-axis{height:clamp(250px,calc(100vh - 470px),560px);
                    height:clamp(250px,calc(100dvh - 470px),560px)}
  .cx-plot{touch-action:pan-y}
  /* the crosshair moves on the compositor (chart.js sets a translateX on the
     phone) and follows the finger without a 60ms lag */
  .cx-line{transition:none;will-change:transform}
  /* three ticks (chart.js emits is-top / is-mid / is-bot on the phone, and
     leaves out any that a tag would overprint); the top and bottom ones hang
     inwards. Same specificity as style.css's :first-child rule, later wins */
  .cx-tick.is-top{transform:translateY(0)}
  .cx-tick.is-mid{transform:translateY(-50%)}
  .cx-tick.is-bot{transform:translateY(-100%)}
  .cx-tag{font-size:9.6px;padding:2px 4px}
  .cx-tag i{font-size:9.2px}
  /* the entrance: the panel's own rise carries the chart in. The 700ms
     clip-path wipe and the tags' slide would start under the panel's cascade
     slot and replay on every timeframe tap under the view-transition
     crossfade — three motions on one object — and clip-path is not
     composited in WebKit. On the phone they do not run; the last-close dot
     keeps its pulse */
  .cx-svg,.cx-vol,.cx-rsi,.cx-tag{animation:none}
  /* tags size to their text and grow leftwards over the plot's edge — never
     stretched to the column and clipped on the right (out-ranks .cx-tag.ask
     and .cx-tag.bid's left:-4px by source order at equal specificity) */
  .cx-axis .cx-tag{left:auto;right:0;min-width:calc(100% + 1px);white-space:nowrap}
  /* a 1px white outline seats every tag on the axis (and replaces the
     Ask/Bid glow, which has nothing to glow over in a 62px column) */
  .cx-axis .cx-tag:not(.cx-tag-spread){box-shadow:0 0 0 1px #fff}
:where(html[data-appearance="dark"]) .cx-axis .cx-tag:not(.cx-tag-spread){box-shadow:0 0 0 1px rgba(255,255,255,0.05)}
  /* Ask and Bid, a spread apart on a 250px plot, are one two-line tag: green
     Ask over red Bid, both rows the same width, centred on the spread */
  .cx-axis .cx-tag-spread{flex-direction:column;align-items:stretch;gap:1px;padding:0;background:none;box-shadow:none;border-radius:0}
  .cx-tag-spread > span{display:flex;align-items:center;justify-content:space-between;gap:4px;padding:1px 4px;color:#fff}
  .cx-tag-spread .cx-tag-a{background:var(--up);border-radius:0 5px 0 0;box-shadow:0 0 0 1px #fff}
:where(html[data-appearance="dark"]) .cx-tag-spread .cx-tag-a{box-shadow:0 0 0 1px rgba(255,255,255,0.05)}
  .cx-tag-spread .cx-tag-b{background:var(--down);border-radius:0 0 5px 0;box-shadow:0 0 0 1px #fff}
:where(html[data-appearance="dark"]) .cx-tag-spread .cx-tag-b{box-shadow:0 0 0 1px rgba(255,255,255,0.05)}
  .cx-vol,.cx-rsi,.cx-sub-r{height:48px}
  /* the sub-charts: the VOL and RSI 14 labels move into the 62px axis column
     (top-right, clear of the first bars and the line), and the RSI line is
     ink-3 — the palette is ink, gold, up and down; there is no violet */
  .cx-sub-lab{left:auto;right:0;width:62px;padding-left:6px;box-sizing:border-box;top:10px;font-size:10px}
  .cx-rsi path{stroke:var(--ink-3)}
  /* the Orders pill carries the count of positions open on this symbol */
  .ctabs .ctab-badge{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;margin:0 -4px 0 6px;
    border-radius:99px;background:var(--ink);color:#fff;font-style:normal;font-size:11px;font-weight:600;line-height:1;
    font-family:'IBM Plex Mono',ui-monospace,monospace}
:where(html[data-appearance="dark"]) .ctabs .ctab-badge{background:var(--ink-fill)}
  .ctabs .mtab.is-on .ctab-badge{background:#fff;color:var(--ink)}
:where(html[data-appearance="dark"]) .ctabs .mtab.is-on .ctab-badge{background:#10152A}

  /* ---------- the dock: Sell · lots · Buy ----------
     The buttons fit inside 56px (6 + 11.6 + 2 + 18.7 + 6 = 44 of text, so
     min-height rules), so the dock measures --dock-h (76) like every other
     dock and the toast keeps one offset everywhere */
  .dock .tk{flex:1 1 0;min-height:56px;padding:6px 10px;gap:2px;border-radius:99px;box-shadow:none;position:relative;overflow:hidden;
    transition:transform var(--t-quick) var(--ease),flex-grow var(--t-base) var(--ease-out),opacity var(--t-base) var(--ease)}
  .dock .tk span{font-size:10.5px;letter-spacing:.08em;line-height:1.1;white-space:nowrap}
  .dock .tk b{font-size:17px;line-height:1.1;white-space:nowrap}
  .dock .tk:hover{transform:none;filter:none}
  .dock .tk:active{transform:scale(.97)}
  .dock .tk:focus-visible{outline:2px solid #fff;outline-offset:-3px}
:where(html[data-appearance="dark"]) .dock .tk:focus-visible{outline:2px solid rgba(255,255,255,0.18)}
  /* while the dock rises into the tab bar's footprint (130 + 420ms) its
     buttons take no taps: a finger reaching for Markets or More cannot land
     on Sell or Buy. chart.js sets the class and clears it at 560ms */
  .dock.is-guard .tk,.dock.is-guard .dock-lots{pointer-events:none}
  /* the second tap: the armed side grows to twice the other and reads
     "CONFIRM BUY · 0.50 @ 1.16148" with a bar draining over the 2.5s it
     waits; the other side steps back (a tap on it cancels). One object
     moves: the armed button; the lots pill holds its 84px */
  .dock .tk.is-arm{flex-grow:2}
  .dock .tk.is-arm b{font-size:15px}
  .dock.is-armed .tk:not(.is-arm){opacity:.6}
  .dock.is-armed .tk:not(.is-arm) b{font-size:13px}
  .dock .tk.is-arm::after{content:'';position:absolute;left:12px;right:12px;bottom:5px;height:3px;border-radius:2px;
    background:rgba(255,255,255,.6);transform-origin:left center;animation:dock-drain 2.5s linear forwards}
:where(html[data-appearance="dark"]) .dock .tk.is-arm::after{background:rgba(255,255,255,0.132)}
  @keyframes dock-drain{from{transform:scaleX(1)}to{transform:scaleX(0)}}
  /* the lots pill is a choice, not a readout: the sunk fill and the line-2
     border of the ticket's order-type select, and a chevron pointing up at
     the sheet it opens */
  /* on the glass the lots control needs no plate of its own: the capsule is
     already a surface, and a second fill between two coloured pills reads as
     a third button. It keeps the chevron that says it opens something. */
  .dock-lots{flex:0 0 78px;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
    background:transparent;border:0;border-radius:99px;color:var(--ink);
    transition:background var(--t-quick) var(--ease),transform var(--t-quick) var(--ease)}
  .dock-lots b{font-size:16px;font-family:'IBM Plex Mono',ui-monospace,monospace;font-weight:600;line-height:1.1}
  .dock-lots span{display:inline-flex;align-items:center;gap:2px;font-size:10.5px;color:var(--ink-4);text-transform:uppercase;letter-spacing:.06em}
  .dock-lots-c{display:inline-grid;place-items:center;width:12px;height:12px;color:var(--ink-4);transform:rotate(180deg);margin-right:-2px}
  .dock-lots-c svg{width:12px;height:12px;stroke-width:2.2}
  .dock-lots:active{background:rgba(12,21,38,.06);transform:scale(.97)}
:where(html[data-appearance="dark"]) .dock-lots:active{background:rgba(255,255,255,0.054)}
  .dock-lots:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
  /* the fill's toast carries a View action (Orders tab); the toast itself
     takes no pointer events, so the button opts back in */
  .toast .toast-act{margin:-6px -8px -6px auto;min-height:40px;padding:0 14px;border-radius:99px;background:rgba(255,255,255,.18);
    color:#fff;font-size:13px;font-weight:600;flex:none;pointer-events:auto;transition:background var(--t-quick) var(--ease)}
  .toast .toast-act:active{background:rgba(255,255,255,.32)}
:where(html[data-appearance="dark"]) .toast .toast-act:active{background:rgba(255,255,255,0.09)}

  /* ---------- the ticket in the sheet ---------- */
  .ticket-sheet{display:grid;gap:10px}
  .ticket-sheet .ticket-mode{width:100%;justify-content:space-between;min-height:44px;padding:0 14px;border-radius:12px;
    background:var(--surface-sunk);color:var(--ink);font-size:14px}
  .ticket-sheet .lots{grid-template-columns:auto 48px minmax(0,1fr) 48px;width:100%}
  .ticket-sheet .lots-btn{width:48px;height:48px}
  .ticket-sheet .lots-btn:hover{background:#fff;color:var(--ink-2);border-color:var(--line-2)}
:where(html[data-appearance="dark"]) .ticket-sheet .lots-btn:hover{background:rgba(255,255,255,0.05)}
  .ticket-sheet .lots-btn:active{background:#EEF1F7;transform:scale(.97)}
:where(html[data-appearance="dark"]) .ticket-sheet .lots-btn:active{background:rgba(255,255,255,0.1)}
  .ticket-sheet .lots-in{height:48px;font-size:20px}
  .ticket-sheet .lots-quick{display:flex;gap:8px}
  .ticket-sheet .lots-quick .fchip{flex:1;min-height:40px;padding:0;display:grid;place-items:center}
  .ticket-sheet .ticket-margin{text-align:left;font-size:13px}
  .ticket-sheet .ticket-foot{text-align:left;font-size:12px}
  .ticket-sheet .ticket-hint{font-size:12px;color:var(--ink-4);line-height:1.45;margin:-4px 0 0}
  .ticket-sheet .ticket-acts{max-width:none;gap:10px}
  .ticket-sheet .tk{min-height:56px;box-shadow:none}
  .ticket-sheet .tk:hover{transform:none;filter:none}
  .ticket-sheet .tk:active{transform:scale(.97)}

  /* ---------- the other tabs: 40/48/56 targets ---------- */
  .prow .pclose{min-height:40px;padding:0 14px}
  .nrow{min-height:56px}
  .calc-in select,.calc-in input{min-height:48px;font-size:16px}   /* 16px: iOS does not zoom into the field */

  /* ---------- reduced motion ---------- */
  @media (prefers-reduced-motion:reduce){
    .cx-tools .round,.dock-lots,.dock .tk,.toast .toast-act{transition:none}
    .cx-tools .round:active,.dock .tk:active,.dock-lots:active,.ticket-sheet .lots-btn:active,.ticket-sheet .tk:active{transform:none}
    .dock .tk.is-arm::after{animation:none;transform:scaleX(1)}
  }
}

/* late fix: the readout wraps rather than clipping mid-number */
@media (max-width:760px){
  .cx-read{flex-wrap:wrap;row-gap:2px;overflow:visible;white-space:normal}
}
