/* generated by scripts/sync_prototype.py from the prototype: copy trade: narrow. Do not edit. */
/* ============================================================
   KCM Copy Trade — the narrow layout (module under 760px wide)
   Decided by the module's own width, not the window: inside the CRM
   the content area may be narrow on a wide screen. The CRM's phone
   tab bar sits below; --ctm-bottom (set by the host) lifts the dock
   and the compare tray clear of it.
   ============================================================ */
@container ctm (max-width:760px){
  .ct-filters{gap:10px}
  .ct-chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0 -14px;padding:0 14px}
  .ct-chips::-webkit-scrollbar{display:none}
  .ct-chips .fchip{white-space:nowrap;flex:none}
  .ct-filters-r{margin-left:0;width:100%;justify-content:space-between}
  .ct-cards,.ct-cards-3{grid-template-columns:minmax(0,1fr)}
  .ct-onb{grid-template-columns:minmax(0,1fr);gap:14px;padding:18px}
  .ct-onb > .btn{grid-column:auto;justify-self:stretch}
  .ct-tray{border-radius:20px;bottom:calc(var(--ctm-bottom,0px) + 12px);padding:10px 12px}
  .ct-tray .btn{width:100%;margin-left:0}
  .ct-prof-h,.ct-cd-h{flex-wrap:wrap;padding:18px;gap:14px;border-radius:var(--r-card)}
  .ct-prof-id h2{font-size:23px}
  .ct-prof-risk{align-items:flex-start;text-align:left;max-width:none;width:100%}
  .ct-cd-val{text-align:left;width:100%}
  .ct-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ct-strip dd{font-size:17px}
  .ct-cd-row{grid-template-columns:minmax(0,1fr);padding:4px 16px 14px}
  .ct-copy,.ct-srow{padding:16px}
  .ct-copy-acts .ct-stop{margin-left:0}
  .ct-copy-acts .btn,.ct-cd-acts .btn{flex:1 1 auto;justify-content:center}
  .ct-wf-r{grid-template-columns:minmax(0,1fr) 84px;gap:4px 10px}
  .ct-wf-track{grid-column:span 2;order:3;height:12px}
  .ct-mini-r{grid-template-columns:auto minmax(0,1fr) auto 14px}
  .ct-mini-lim{display:none}
  .ct-hero{padding:20px}
  .ct-hero-val{font-size:38px}
  .ct-ev{grid-template-columns:minmax(0,1fr);gap:4px}
  .ct-ev-k{justify-self:start}
  .ct-drivers li{grid-template-columns:120px minmax(0,1fr) 20px}
  .ct-bands li{grid-template-columns:minmax(0,1fr)}
  .ct-facts{grid-template-columns:minmax(0,1fr)}
  .ct-ph-acts{margin-left:0;width:100%}
  .ct-ph-acts .btn{flex:1;justify-content:center}
  .ct-share{grid-template-columns:minmax(0,1fr);justify-items:center}
}

/* the pop-ups cover the screen, so on a phone-sized screen they rise from
   the foot like the portal's sheet, whatever the module's own width */
@media (max-width:760px){
  #ctm-glass:has(.ct-modal){place-items:end stretch;padding:0}
  .ct-modal{width:100% !important;max-height:92%;border-radius:24px 24px 0 0;padding:22px 18px calc(18px + env(safe-area-inset-bottom)); background:var(--surface);-webkit-backdrop-filter:none;backdrop-filter:none}
  .ct-steps{gap:2px;margin-right:34px}
  .ct-steps li{padding:4px 8px 4px 4px;font-size:12.4px}
  .ct-steps li:not(.is-on){font-size:0;gap:0;padding-right:4px}
  .ct-lim-opts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ct-amt input{font-size:34px}
  .ct-adv-r{flex-wrap:wrap}
  .ct-rev > div{grid-template-columns:minmax(0,1fr);gap:2px}
  .ct-flow-f{position:sticky;bottom:calc(-18px - env(safe-area-inset-bottom));background:var(--surface);margin:18px -18px -18px;padding:14px 18px calc(14px + env(safe-area-inset-bottom))}
  .ct-flow-f > p{display:none}
  .ct-flow-f .btn{flex:1}
}

/* the dock: the screen's one action, at the foot of the content, above
   the CRM's own tab bar */
.is-narrow .ctm-dock{display:none}
.is-narrow.is-docked .ctm-dock{display:flex;align-items:center;gap:10px;position:sticky;z-index:30;
  bottom:calc(var(--ctm-bottom,0px) + 10px);margin-top:18px;padding:9px 9px 9px 12px;border-radius:22px;
  background:rgba(255,255,255,.9);-webkit-backdrop-filter:blur(18px) saturate(170%);backdrop-filter:blur(18px) saturate(170%);
  box-shadow:0 16px 36px -18px rgba(12,21,38,.45),inset 0 1px 0 #fff}
:where(html[data-appearance="dark"]) .is-narrow.is-docked .ctm-dock{background:rgba(16,21,42,0.9);box-shadow:0 16px 36px -18px rgba(0,0,0,0.75),inset 0 1px 0 rgba(255,255,255,0.35)}
.ctm-dock .dock-i{width:34px;height:34px;border-radius:50%;background:var(--surface-sunk);display:grid;place-items:center;flex:none}
.ctm-dock .dock-i svg{width:16px;height:16px}
.ctm-dock .dock-t{flex:1;min-width:0}
.ctm-dock .dock-t b{display:block;font-size:13.6px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ctm-dock .dock-t span{display:block;font-size:11.8px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ctm-dock .btn{min-height:44px;border-radius:99px;font-weight:600;padding:0 16px;white-space:nowrap}
.is-narrow[data-page="Copy detail"] .ctm-dock .btn{flex:1;min-width:0;padding:0 10px}
.is-narrow[data-page="Strategy"] .ct-copycard .btn.w{display:none}

/* ============================================================
   Phone, second pass (2026-09-30): less height, same features.
   The header folds into three rows, tables become lists, cards and
   tiles tighten, and each screen keeps one clear action.
   ============================================================ */
@container ctm (max-width:760px){
  /* header: title + role on one row, accounts, then tabs + help icon */
  .ctm-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px 8px;margin-bottom:12px}
  .ctm-head > .ctm-top,.ctm-head > .ctm-nav{display:contents}
  .ctm-title{grid-column:1;grid-row:1;font-size:24px}
  .ctm-nav > .ctm-role{grid-column:3;grid-row:1;order:0;width:auto;margin:0;display:flex}
  .ctm-nav > .ctm-role .seg{padding:6px 12px;font-size:12.6px}
  .ctm-accts{grid-column:1 / -1;grid-row:2;margin:0}
  .ctm-tabs{grid-column:1 / -1;grid-row:3;border-bottom:1px solid var(--line-2);-webkit-mask-image:none;mask-image:none;padding-right:0}
  .ctm-tabs{justify-content:space-between}
  .ctm-head > .ctm-sub{grid-column:2;grid-row:1;margin:0;display:flex;align-items:center;justify-self:start}
  .ctm-sub .ctm-help span{display:none}
  .ctm-sub .ctm-help{padding:6px 2px}
  .ctm-sub .ctm-help svg{width:18px;height:18px}
  .ctm-tab{padding:10px 6px;font-size:13.4px;white-space:nowrap}
  /* account switcher: never overlaps; the action stays short */
  .ctm-acct-btn{padding:6px 10px 6px 14px}
  .ctm-acct-t{min-width:0;overflow:hidden}
  .ctm-acct-t small,.ctm-acct-t b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ctm-acct-v{white-space:nowrap}
  .ctm-act{padding:11px 14px}
  .ctm-act-x,.ctm-act-e{display:none}
  .pagehead.ctm-ph{margin-bottom:10px}
  .pagehead.ctm-ph p{font-size:12.8px}

  /* summary tiles: small and side by side */
  .ct-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}
  .ct-tiles:not(:has(> :nth-child(4))){grid-template-columns:repeat(3,minmax(0,1fr))}
  .ct-tiles > div{padding:11px 12px;border-radius:14px}
  .ct-tiles span{font-size:11px}
  .ct-tiles b{font-size:18px;margin-top:2px}
  .ct-tiles b em{font-size:10.5px;margin-left:3px}
  .ct-tiles small{display:none}
  .ct-hero{padding:16px 18px;gap:12px}
  .ct-hero-val{font-size:32px}
  .ct-hero-sub{font-size:12.4px}
  .ct-hero-acts .btn{padding:9px 14px;font-size:13px}

  /* Master cards and copy cards */
  .ct-copies{gap:10px}
  .ct-copy,.ct-srow{padding:14px}
  .ct-copy .ct-copy-stats,.ct-srow .ct-copy-stats{margin-top:10px;padding:10px 12px;gap:8px 12px}
  .ct-copy .ct-copy-stats dt,.ct-srow .ct-copy-stats dt{font-size:10.8px}
  .ct-copy .ct-copy-stats dd,.ct-srow .ct-copy-stats dd{font-size:13.6px}
  .ct-copy-ev{margin-top:8px;font-size:11.8px}
  .ct-copy-acts{padding-top:10px;gap:6px}
  .ct-copy-acts .btn,.ct-srow .ct-copy-acts .btn{padding:8px 10px;font-size:12.8px}
  .ct-linkbox.is-row{margin-top:10px}

  /* Discover and For you: shorter cards */
  .ct-cards{gap:10px}
  .ct-card{padding:14px 14px 12px}
  .ct-card .ct-av{width:38px;height:38px;border-radius:12px;font-size:13px}
  .ct-card-chart{height:38px;margin:8px -2px 0}
  .ct-card-chart svg{height:38px}
  .ct-card-stats{margin-top:8px;padding-top:8px;gap:6px}
  .ct-card-stats dt{font-size:10.6px}
  .ct-card-stats dd{font-size:15px;margin-top:1px}
  .ct-card-foot{font-size:11.2px;margin-top:6px;gap:2px 8px}
  .ct-card-foot > span + span::before{margin-right:8px}
  .ct-card-acts{margin-top:10px}
  .ct-card-acts .btn{padding:8px 10px;font-size:13px}

  /* a strategy's page: the dock carries Copy, so the page doesn't repeat it */
  .ctm-root .ct-prof-risk .ct-copy-cta{display:none}
  .ct-side .ct-copycard{display:none}
  .ct-prof-h{padding:16px;gap:12px}
  .ct-prof-h .ct-av.is-lg{width:48px;height:48px;border-radius:14px;font-size:15px}
  .ct-prof-id h2{font-size:21px}
  .ct-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
  .ct-strip > div{padding:10px 12px}
  .ct-strip dt{font-size:10.6px}
  .ct-strip dd{font-size:15px}

  /* a copy's page: its card holds the buttons (no dock) */
  .ct-cd-card{padding:16px;gap:12px}
  .ct-cd-card .ct-cd-acts{display:grid}
  .ct-cd-card .ct-cd-val{padding:12px 14px}
  .ct-cd-card .ct-cd-val b{font-size:26px}

  /* tables become lists */
  .ct-has-m .ct-tablewrap{display:none}
  .ct-has-m.panel-flush{padding:4px 16px}
  .ct-mlist{display:block}
  .ct-mli{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:3px 12px;padding:12px 0;border-bottom:1px solid var(--line)}
  .ct-mli:last-child{border-bottom:0}
  .ct-mli b{font-size:14px;font-weight:600;min-width:0}
  .ct-mli small{font-size:11.8px;color:var(--ink-3);min-width:0}
  .ct-mli .r{text-align:right;justify-self:end}
  .ct-mli .chip{font-size:11px;padding:2px 8px}
  .ct-mli.is-skip{background:#FFFBF1;margin:0 -16px;padding:12px 16px}
:where(html[data-appearance="dark"]) .ct-mli.is-skip{background:rgba(228,188,88,0.14)}
  .ct-skipnote{flex-wrap:wrap;font-size:12.4px}

  /* activity */
  .ct-ev{padding:12px 0;gap:6px 12px;grid-template-columns:minmax(0,1fr) auto}
  .ct-ev b{font-size:13.6px}
  .ct-ev p{font-size:12.6px}
  .ct-ev > em{font-size:11px}
  .mtabs{margin-bottom:10px}
}

@media (max-width:760px){
  /* the copy sheet: settings sit beside their controls; the preview is one strip */
  .ct-adv-r{flex-wrap:nowrap;gap:12px;align-items:center;padding:12px 0}
  .ct-adv-r > div:first-child{flex:1;min-width:0}
  .ct-adv-r > div:first-child b{font-size:13.6px}
  .ct-adv-r small{font-size:11.4px;line-height:1.35}
  .ct-adv-r .segs .seg{padding:6px 10px;font-size:12.2px}
  .ct-num-in{height:36px;padding:0 10px}
  .ct-num-in input{width:44px;font-size:14px}
  .ct-prev{padding:12px 14px;border-radius:14px;margin-top:12px}
  .ct-prev-lab{display:none}
  .ct-prev-lot{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;margin:0 0 8px}
  .ct-prev-lot span{font-size:12px}
  .ct-prev-lot b{font-size:16px}
  .ct-prev-lot svg{transform:rotate(-90deg);width:12px;height:12px}
  .ct-prev-l{gap:4px;padding-top:8px}
  .ct-prev-l li{font-size:12px}
  .ct-prev-n{display:none}
  .ct-acctd{padding:12px}
  .ct-acctd-kv{gap:6px 12px;margin-top:8px}
  .ct-kvd{gap:6px 14px}
  .ct-pair-m{padding:12px}
  .ct-sq{font-size:17px}
  .ct-done-i{width:48px;height:48px}
  .ct-done h3{font-size:19px}
}

@media (max-width:760px){
  /* two actions in a pop-up's foot share the row; long labels never wrap */
  .ct-flow-f .btn{white-space:nowrap;padding-left:14px;padding-right:14px}
  .ct-flow-f > span:empty{display:none}
}
@container ctm (max-width:760px){
  .ct-skipnote .ct-link{padding:8px 0}
}
.ctm-dock .ct-dock-b{flex:1;justify-content:center;height:46px}
